home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 August: Tool Chest / Dev.CD Aug 98 TC.toast / Tool Chest / Testing & Debugging / Mac OS Development Toolkit / Automation Essentials 2.3.0 / • Other Stuff / Cool SPEC Documents / SPEC 1.2.1b3 X-Ref < prev    next >
Encoding:
Text File  |  1998-03-19  |  311.0 KB  |  7,899 lines  |  [TEXT/MPS ]

  1.  
  2.  
  3. ##############################################################
  4. ##############################################################
  5. SPEC Libraries Cross Reference.
  6. Goal: to provide a comprehensive file of all SPEC tasks, with 
  7. cross-referencing to allow faster tracing of code.
  8.  
  9. Conventions:
  10. For each task, the actual task name and parameters are listed,
  11. followed by the library, and the task header.
  12. After the header is a list of library tasks called by this task, 
  13. followed by a list of tasks that call this task.
  14.  
  15. Standard tasks in a list include the parentheses [task()].
  16. Task references or hooks in the list do NOT include parentheses 
  17. [TaskReference or gTaskHook].
  18. For tasks called from more than 12 other tasks, the is called by 
  19. list will include just the libraries that reference this task.
  20. Built-in tasks and VU commands are NOT listed.
  21.  
  22. Jay Loucks        9602.14
  23. ##############################################################
  24. ##############################################################
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35. ##############################################################
  36. ##############################################################
  37. ##############################################################
  38. Library: CrashHandling.lib
  39. Calls: "Results Express.lib","FileToolOperations.lib","TCS.lib",
  40. "ExceptionHandling.Lib","Output.Lib",
  41. "String.Lib", "MemoryMonitorOperations.Lib";
  42.  
  43. Task:    GatherTargetCrashLog( pErrorCode, pAbortSuite := 1, pAppleScriptMethod := 1 )
  44. Library:    CrashHandling.lib
  45. Header:
  46. #########################################################################
  47. #    GatherTargetCrashLog( pErrorCode, pAbortSuite, pAppleScriptMethod )
  48. #========================================================================
  49. # Author:        KTA 
  50. # Description:    1) Initializes filetool on the target.
  51. #                2) checks to see if a file named "CRASHLOG" exists on the root
  52. #                   of boot vol.
  53. #                3) Moves a copy of the macsbug data to 'CrashLogs ƒ' on the root.
  54. #                4) Reads the file using FileTool
  55. #                5) Writes a testcase that includes the data using ResultsExpress.
  56. #                6) Deletes the working copy of the file
  57. #                Note: Step 4 and 5 may be controlled with either AppleScript
  58. #                    or VU.  AppleScript is the preferred method as VU has a 
  59. #                    2000 character string limit.  If the AppleScript method fails,
  60. #                    we try again using VU.
  61. #                    
  62. # Parameters:    pErrorCode - The error code that VU recieved when it 1st detected 
  63. #                            the crash.
  64. #                pAbortSuite - a Flag to indicate whether we wish to abort
  65. #                                the current suite because of the crash.
  66. #                pAppleScriptMethod - a flag used to indicate whether to use
  67. #                            AppleScript or not (for initiating steps 3 and 4 only).
  68. # Returns:        Nothing
  69. # Examples:        GatherTargetCrashLog( -1100, 1)
  70. # Assumptions:    
  71. #########################################################################
  72. Calls:    _FileTool( "initialize"), _FileTool( "FileExists"), GetRenameCrashLogAs(), _FileTool( "Rename"), 
  73.         logstr(),GatherWithAppleScript(), DeleteTheFile(), QuitFileTool(), CleanAbort(), 
  74.         TCSStart(), TCSEnd(), 
  75. Is called by:    DefaultCrashHandler() 
  76.  
  77.  
  78. Task:    GatherWithAppleScript( pErrorCode, pTCSpecifier)
  79. Library:    CrashHandling.lib
  80. Header:
  81. #########################################################################
  82. #                GatherWithAppleScript( pErrorCode, pTCSpecifier )
  83. #========================================================================
  84. # Author:        KTA 
  85. # Description:    Steps 4 and 5 of GatherTargetCrashLog() using AppleScript
  86. #                1) …
  87. #                2) …
  88. #                3) …
  89. #                4) Reads the file using FileTool
  90. #                5) Writes a testcase that includes the data using ResultsExpress.
  91. #                    
  92. # Parameters:    pErrorCode - The error code that VU recieved when it 1st detected 
  93. #                            the crash.
  94. #                pTCSpecifier - The data used to identify the testcase if the form:
  95. #                                {Number,"Set","Type","Owner","Description", Result}
  96. # Returns:        true - succesful
  97. #                false - an error occured
  98. # Examples:        GatherWithAppleScript( -1100 , {2,"Set","Type","Owner","Description", -3});
  99. #
  100. # Assumptions:    
  101. #########################################################################
  102. Calls:    AppleScriptString()
  103. Is called by:    GatherTargetCrashLog()
  104.  
  105.  
  106. Task:    DefaultCrashHandler(pErrID, pParamList := {1,1,1})
  107. Library:    CrashHandling.lib
  108. Header:
  109. #########################################################################
  110. #                DefaultCrashHandler(pParamList)
  111. #========================================================================
  112. #    Description:    simple Crash handler prototype
  113. #    Parameters:        pParamList:    list of parameters
  114. #                        element 1 := What to do about the suite(1 - Fail the suite/0 don't fail the suite)
  115. #                        element 2 := What to do if can't aquire target (1 - abort script/0-suspend)
  116. #                        element 3 := What to do if can't gather crashlog (1 - abort script/0-turn off crashHandler but continue)
  117. #                        element 4 := [optional] Throw when done or not - will throw whatever it is defined as
  118. #    Returns:        result of error handler TASK call, or throw if fatal
  119. #    Examples:        DefaultCrashHandler({1})
  120. #    Assumptions:    VU 2.1
  121. #========================================================================
  122. Calls:    LogStr(), _matchBoolean(), ReacquireTarget(), TCSStart(), TCSEnd(), 
  123.         gConfirmReacquireTargetHook, ClearStack(), InstallEveryTimeMacro()
  124. Is called by:    InitGlobals(), CheckforSystemFailure()
  125.  
  126.  
  127. Task:    ReacquireTarget(pTargetName := global gMachineName, pZoneName := "*")
  128. Library:    CrashHandling.lib
  129. Header:
  130. #########################################################################
  131. #                            ReacquireTarget()
  132. #========================================================================
  133. # Author:        KTA
  134. # Description:    
  135. # Parameters:    None
  136. # Returns:        Nothing
  137. # Examples:        
  138. # Assumptions:    
  139. #########################################################################
  140. Calls:    CommandTimeOut(), acquireTarget(), _matchBoolean(), LogStr()
  141. Is called by:    DefaultCrashHandler(), 
  142.  
  143.  
  144. Task:    InstallEveryTimeMacro(pMacroCommands := global gMacroCommands)
  145. Library:    CrashHandling.lib
  146. Header:
  147. #########################################################################
  148. #                InstallEveryTimeMacro()
  149. #========================================================================
  150. #    Description:    Sends a Debug sting that invokes the everytime macro and
  151. #                    restarts the target if there was a crash.
  152. #    Parameters:        pMacroCommands - commands to be included in the everytime
  153. #                        macro which will execute when the target crashes.
  154. #    Returns:        nothing
  155. #    Examples:        InstallEveryTimeMacro('HOW; WH; TD; HT; SC;');
  156. #    Assumptions:    VU 2.1
  157. #========================================================================
  158. Calls:    PathToSpecialFolder(), DoesFileExist(), _FileTool(), QuitFileTool(), MemoryMonitorInit(), _MemoryMonitor(), LogStr(),  _DebugStr(), 
  159. Is called by:    DefaultCrashHandler(), SuiteStart()
  160.  
  161.  
  162. Task:    GetRenameCrashLogAs()
  163. Library:    CrashHandling.lib
  164. Header:
  165. #########################################################################
  166. #                GetRenameCrashLogAs()
  167. #========================================================================
  168. # Author:        ML
  169. # Description:    Accesser for getting the name that the crash log will
  170. #                be renamed as.
  171. # Parameters:    none
  172. # Returns:        gRenameCrashLogAs
  173. # Examples:        GetRenameCrashLogAs();
  174. # Assumptions:    None 
  175. #========================================================================
  176. Calls:
  177. Is called by:    GatherTargetCrashLog(), 
  178.  
  179.  
  180. Task:    SetRenameCrashLogAs(pName)
  181. Library:    CrashHandling.lib
  182. Header:
  183. #########################################################################
  184. #                SetRenameCrashLogAs(pName)
  185. #========================================================================
  186. # Author:        ML
  187. # Description:    Accesser for setting the name that the crash log will
  188. #                be renamed as.
  189. # Parameters:    none
  190. # Returns:        none
  191. # Examples:        SetRenameCrashLogAs("my custom log name")
  192. # Assumptions:    None 
  193. #========================================================================
  194. # History:
  195. # 5/16/95    ML    created
  196. #########################################################################
  197. Calls:
  198. Is called by:    
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207. ##############################################################
  208. ##############################################################
  209. ##############################################################
  210. Library: Custom.Lib
  211. Calls:    {user defined}
  212.  
  213.  
  214. Task:    InitCustom() 
  215. Library:    Custom.Lib
  216. Header:
  217. #########################################################################
  218. #                            InitCustom()
  219. #========================================================================
  220. # Author:        KTA
  221. # Description:    This has been provided as a mechanism for scriptwriters to 
  222. #                customize the SPEC S&L Libraries.  If the default value of
  223. #                and global variables is not what is desired, this is the 
  224. #                task where the script writer should reset any global values.  
  225. #                This task is called from InitGloabls() immediately after all
  226. #                global variables have been defined.
  227. #                Please refer to 'The Hitchhikers Guide' for more information 
  228. #                concerning any individual global variables.
  229. # Parameters:    None
  230. # Returns:        Nothing
  231. # Examples:        InitCustom();
  232. # Assumptions:     
  233. #########################################################################
  234. Calls:    {user defined}
  235. Is called by:    InitGloabls()
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244. ##############################################################
  245. ##############################################################
  246. ##############################################################
  247. Library: DA.Lib
  248. Calls: "Output.Lib","TCS.Lib","LaunchQuit.Lib","TargetCheck.Lib",
  249. "UserInterface.Lib", "ExceptionHandling.Lib"
  250.  
  251.  
  252.  
  253. Task:    Scrapbook(requestElement,ccpFlag := 1,pasteFlag := 1) 
  254. Library:    DA.Lib
  255. Header:
  256. #########################################################################
  257. #                Scrapbook(requestElement,ccpFlag,pasteFlag)
  258. #========================================================================
  259. # Author:        KTA
  260. # Description:    This routine will select the scrapbook, scroll to the
  261. #                designated requestElement position, select Cut, Copy, Paste,
  262. #                or Clear from the Edit menu, close the scrapbook if under System
  263. #                6.0.x, and then select Paste if the pasteFlag parameter is 1.
  264. # Parameters:    requestElement - the element in the scrapbook to scroll to
  265. #                ccpFlag -    1 for copy
  266. #                            2 for cut
  267. #                            3 for paste
  268. #                            4 for clear
  269. #                pasteFlag - 1 to paste after closing Scrapbook
  270. #                            0 not to paste after closing Scrapbook
  271. # Returns:        0 - Couldn't complete operation
  272. #                element - Scrapbook element that operation took place on
  273. # Examples:        Scrapbook(2) will scroll the horizontal bar to the
  274. #                second entry and then copy, close and paste.
  275. # Assumptions:    That the scrollbars are present. That the string
  276. #                'Scrapbook' appear somewhere in the name
  277. #========================================================================
  278. Calls:    LogStr(), TCSStart(), TCSEnd(), MatchApplication(), LaunchTwitch(), 
  279.         _match (), _scroll (), ExceptionDispatcher(), SelectMenuItem(), keyEq(), 
  280.         closeWindow(), 
  281. Is called by:    DoSetUpApp()
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291. ##############################################################
  292. ##############################################################
  293. ##############################################################
  294. Library: DoTasks.Lib
  295. Calls: "OutPut.Lib","Font.Lib","StandardFile.Lib","TCS.Lib","Draw.Lib",
  296. "Print.Lib","LaunchQuit.Lib","Misc.Lib","TargetCheck.Lib", "DA.Lib",
  297. "UserInterface.Lib", "ExceptionHandling.Lib"
  298.  
  299.  
  300. Task:    DoDraw(pTestMethod := -1, pSpecifier := 0, pNumTimes := 1 )
  301. Library:    DoTasks.Lib
  302. Header:
  303. #########################################################################
  304. #                        DoDraw( pTestMethod, pSpecifier, pNumTimes )
  305. #========================================================================
  306. # Author:        KTA
  307. # Description:    This task is a high level task which controls the amount and
  308. #                type of draw testing which will be automatically performed (based upon
  309. #                predefined application specific data structures).  
  310. # Parameters:    pTestMethod - the method of testing desired.
  311. #                            1 - random object will be generated <pNumtimes> times.
  312. #                            2 - a random object will be generated for all tools
  313. #                                defined in the gToolList.
  314. #                pSpecifier - (String, integer, descriptor) window pSpecifier in
  315. #                            which drawing will occur.
  316. #                pNumTimes - (integer) number of times to perform the <pTestMethod>.
  317. # Task references : A number of global undefined task references have been provided 
  318. #                    to allow scriptwriters the ability to customize calls to DoDraw();
  319. #                        gDoDrawHook1 - prior to any drawing.
  320. #                        gDoDrawHook2 - after drawing each individual object
  321. #                        gDoDrawHook3 - after completion of drawing all objects
  322. # Returns:        Nothing
  323. # Examples:        DoDraw(1,1,1)
  324. # Assumptions:    Data Structures are set up correctly (see the HitchHiker's guide for details)
  325. # Notes:        If the pTestMethod parameter is not explicitly passed in it
  326. #                can be set by defining the global gDrawLevel. gDrawLevel can
  327. #                be an integer or a list.  If gDrawLevel is an integer it will be
  328. #                used as the pTestMethod input parameter. If gDrawLevel is a list
  329. #                the 1st element is the pTestMethod, the 2nd is the pNumTimes parameter.
  330. #========================================================================
  331. Calls:    gDoDrawHook1, RandomDrawObject(), DrawObject(), gDoDrawHook2, gDoDrawHook3
  332. Is called by:    DoWPTools()
  333.  
  334.  
  335. Task:    DoWindow(pTestMethod := -1, pSpecifier := 0, pRestoreWindow := 0, pNumTimes := 1 )
  336. Library:    DoTasks.Lib
  337. Header:
  338. #########################################################################
  339. #        DoWindow( pTestMethod, pSpecifier, pRestoreWindow, pNumTimes )
  340. #========================================================================
  341. # Author:        KTA
  342. # Description:    This task is a high level task which controls the amount and
  343. #                type of window testing which will be automatically performed.  
  344. # Parameters:    pTestMethod - the method of testing desired.
  345. #                            1 - a less complete window test (functionlist build 
  346. #                                dynamically based on gDoWindowList see below)
  347. #                            2 - complete window test scrolling, sizing, dragging, zooming.
  348. #                pSpecifier - (String, integer, descriptor) window pSpecifier for 
  349. #                            to be exercised.
  350. #                pRestoreWindow - Boolean - indicates whether or not to restore 
  351. #                                the window to it's original condition.
  352. #                pNumTimes - (integer) number of times to perform the <pTestMethod>.
  353. # Returns:        Nothing
  354. # Examples:        DoWindow(1,0,0,2)
  355. # Assumptions:    
  356. # Notes:        For more info in what each test does see TestWindow() in 
  357. #                'UserInterface.lib'. 
  358. #                If the pTestMethod parameter is not explicitly passed in it
  359. #                can be set by defining the global gWindowLevel. gWindowLevel can
  360. #                be an integer or a list.  If gWindowLevel is an integer it will be
  361. #                used as the pTestMethod input parameter. If gWindowLevel is a list
  362. #                the 1st element is the pTestMethod, the 2nd is the pNumTimes parameter.
  363. #
  364. #                A global, gDoWindowList, has been provided as a way to indicate
  365. #                which tests are available for a given application.
  366. #                NOTE: This is only valid if pTestWindow evaluates to 2.
  367. #                e.g. global gDoWindowList := {1,1,1,1};
  368. #                 Set each element to 1 or 0.  
  369. #                Flag for performing DoWindows tests as follows:
  370. #                 Element: 1 - Sizing
  371. #                         2 - Scrolling
  372. #                         3 - Dragging
  373. #                         4 - Zooming
  374. #
  375. #========================================================================
  376. Calls:    gSetupDoWindow, TestWindow(), gDoWindowTailPatch
  377. Is called by:    
  378.  
  379.  
  380.  
  381. Task:    DoText(pTestMethod := -1, pNumTimes := 1)
  382. Library:    DoTasks.Lib
  383. Header:
  384. #########################################################################
  385. #                        DoText(pTestMethod, pNumTimes)
  386. #========================================================================
  387. # Author:        KTA
  388. # Description:    This task is a high level task which controls the amount and
  389. #                type of font testing which will be automatically performed.  
  390. # Parameters:    pTestMethod - the method of testing desired.
  391. #                            1 - Random font test
  392. #                            2 - QuickLook font test
  393. #                            3 - WaterFall font test
  394. #                pNumTimes - (integer) number of times to perform the <pTestMethod>.
  395. #                            (not valid for WaterFall testing)
  396. # Returns:        nada
  397. # Examples:        DoText(2,3);
  398. # Assumptions:    global gFontList, gFontSizeList, gFontStyleList must be defined.
  399. # Notes:         If the pTestMethod parameter is not explicitly passed in it
  400. #                can be set by defining the global gFontLevel. gFontLevel can
  401. #                be an integer or a list.  If gFontLevel is an integer it will be
  402. #                used as the pTestMethod input parameter. If gFontLevel is a list
  403. #                the 1st element is the pTestMethod, the 2nd is the pNumTimes parameter.
  404. #========================================================================
  405. Calls:    InitFonts(), gSetupDoText, RandomFontRecords(), SetFontParams(), TypeStr(), 
  406.         ReportSelectedMenuItems(), WaterFallFontTest(), gClearDoText
  407. Is called by:    
  408.  
  409.  
  410. Task:    DoFiles(pTestMethod := -1,pFileName := "",pSaveAsFlag := 1, pSelectOpen := 2, pRevertMI := '')
  411. Library:    DoTasks.Lib
  412. Header:
  413. #########################################################################
  414. #        DoFiles(pTestMethod, pFileName, pSaveAsFlag, pSelectOpen, pRevertMI )
  415. #========================================================================
  416. # Author:        KTA
  417. # Description:    This task is a high level task which controls the amount and
  418. #                type of file testing which will be automatically performed.
  419. # Parameters:    pTestMethod - Method of testing 
  420. #                            1 - All tests outlined below
  421. #                            2 - Save As/Replace, close, open.
  422. #                            3 - Save As/Cancel, Save, modify, revert.
  423. #                            4 - Save/Cancel,Save(unique), Save (same file name)/Replace,
  424. #                                Save (same file name)/create unique extension.
  425. #                            5 -    Save As/Cancel, Save
  426. #                pFileName - File name to use when saving file if none passed
  427. #                            a filename will be generated bassed on the 
  428. #                            applications name and the time.
  429. #                pSaveAsFlag - Valid for all Testmethods. Indicates whether 
  430. #                             selecting the Save As menuItem is necessary.
  431. #                                 1 - select Save As. HardCoded 'Save As'.
  432. #                                0 - Do not select SaveAs.
  433. #                                list - list containing ordinality of 'Save As' menuItem.
  434. #                            This parameter has been updated for international support.
  435. #                            Now it can also be a list which contains the ordinality of 
  436. #                            the Save As menuItem. If a it is a list then the Save As menuItem
  437. #                            will be selected using the contents of the list.
  438. #                            e.g. if pSaveAsFlag = {6,2}, the sixth menuitem from the 2nd menu will
  439. #                            be selected as the Save As menuItem.
  440. #                pSelectOpen - Only valid if <pTestMethod> evaluates to 2
  441. #                            0 - Don't select 'Open' or anything else
  442. #                            1 - Select 'Open' - hard coded
  443. #                            2 - Select 'Open' by way of keyboard equivelant 'o'.
  444. #                            list - list containing ordinality of 'Open' menuItem.
  445. #                pRevertMI - Only valid if <pTestMethod> evaluates to 3
  446. #                            '' - Hard coded 'Revert' menuItem will be selected
  447. #                            list - list containing ordinality of revert MenuItem
  448. # Returns:        nada
  449. # Examples:        DoFiles(2, "myFile", {6,2}, {4,2});            # Save, close, open.
  450. # Assumptions:    
  451. #========================================================================
  452. Calls:    DoFiles(), SaveAs(), CloseWindow(), OpenFile(), CancelStandardFile(), 
  453.         Save(), ModifyDocument(),  Revert(), 
  454. Is called by:    DoSetUpApp(), DoCloseApp(), Do Files()
  455.  
  456.  
  457. Task:    TASK DoSetUpApp(pDismissOpeningDialog:=0, pDefaultWindowSpec:=0, 
  458.         pNewDocPath:={'New','File'}, pDismissNewDocDialog:=0,pScrapText:=0, 
  459.         pScrapPict:=0, pSaveDoc:=1, pOpenDoc := 2)
  460. Library:    DoTasks.Lib
  461. Header:
  462. #########################################################################
  463. #     DoSetUpApp(pDismissOpeningDialog, pDefaultWindowSpec, pNewDocPath,
  464. #  pDismissNewDocDialog,pScrapText, pScrapPict, pSaveDoc, pOpenDoc)
  465. #=======================================================================
  466. # Author:              ML
  467. #
  468. # Description:        Sets up app after launch.  Matches app, closes default
  469. #                    window, creates a new document, optionally pastes from scrap, 
  470. #                    saves document.
  471. #
  472. # Parameters:        pDismissOpeningDialog - 0    No opening dialog
  473. #                                               1    type return key
  474. #                                        'string' select button named {string}        
  475. #                    pDefaultWindowSpec -    if -1, no default window - don't close         
  476. #                                            if 0, close first document window
  477. #                                            if string, then it holds title of window
  478. #                                            if integer > 0, then it holds ordinality of window
  479. #                                            Descriptor -  window descriptor
  480. #                    pNewDocPath -            0    don't create new doc
  481. #                                          {list} - containing ordinality of 'New' menuItem
  482. #                                            
  483. #                    pDismissNewDocDialog -     0    No new doc dialog
  484. #                                               1    type return key
  485. #                                        'string' select button named {string}
  486. #                    pScrapText -            0    Don't call Scrapbook(global ScrapText)
  487. #                                            1    call Scrapbook(global ScrapText)
  488. #                    pScrapPict -            0    Don't call Scrapbook(global ScrapPict)
  489. #                                            1    call Scrapbook(global ScrapPict)
  490. #                    pSaveDoc    -                0    Don't save newly created doc via DoFiles(2)
  491. #                                            1    Save newly created doc via DoFiles(2)
  492. #                                          {list} - containing ordinality of Save As menuItem
  493. #                    pOpenDoc    -            0    Don't save select 'Open' menuitem
  494. #                                            1    Select 'open' menuItem - hardcoded
  495. #                                            2    - keyEq('o');
  496. #                                          {list} - containing ordinality of 'Open' menuItem
  497. #                    
  498. # Task references : A number of global undefined task references have been provided 
  499. #                    to allow scriptwriters the ability to customize calls to DoSetUpApp();
  500. #                        gCustomScrapText - instead of generic Scrapbook(kScrapTEXT)
  501. #                        gCustomScrapPict - instead of generic Scrapbook(kScrapPICT)
  502. #                        gSetUpForSaveDoc - To do any setup before calling DoFiles(2)
  503. # Returns:            None
  504. #
  505. # Example:            DoSetUpApp(0,1,{'New','File'},0,0,0,1)
  506. #=======================================================================
  507. Calls:    gDoSetUpAppHook1, LogStr(), MatchApplication(), findWindow(), TCSStart(), 
  508.         TCSEnd(), gDoSetUpAppHook2, ProfileApplication(), _matchBoolean (), CloseWindow(),
  509.         gScriptBeginCriticalHook, gCustomScrapText, Scrapbook(), gScriptEndCriticalHook, 
  510.         gSetUpForSaveDoc, DoFiles(), 
  511. Is called by:    
  512.  
  513.  
  514. Task:    DoCloseApp(pSaveRevert := 0, pDismissAboutBox := 0, 
  515.         pPageSetup := 1, pPrinter := 1, pQuit := 1)
  516. Library:    DoTasks.Lib
  517. Header:
  518. #########################################################################
  519. #     DoCloseApp(pSaveRevert, pDismissAboutBox, pPageSetup, pPrinter, pQuit)
  520. #=======================================================================
  521. # Author:              ML
  522. # Description:        Performs either DoFiles(3) or Dofiles(5), Selects and dismisses
  523. #                    the 'About' box, Selects and dismisses 'Page Setup', Selects and
  524. #                    dismisses 'Print', thenpQuits.
  525. # Parameters:        pSaveRevert -    0 - Save As/Cancel/Save, no modify/revert
  526. #                                    1 - Save As/Cancel/Save, modify/revert
  527. #                                   -1 - no Save As/Cancel/Save, no modify/revert
  528. #                                    {list} - International - two elements 
  529. #                                        1st element 
  530. #                                            list - list containing ordinality of 'Revert' menuItem.
  531. #                                            integer - Any of the pSaveRevert options listed above.
  532. #                                        2nd Element - should be set even if 1st element is 0
  533. #                                            list - list containing ordinality of 'Save As' menuItem.
  534. #                    pDismissAboutBox -  -1 - Don't do About Box test
  535. #                                        0 - Return key
  536. #                                        integer > 0     - Click in center of 
  537. #                                                        screen {integer} times
  538. #                                        String -  Select button named <string>
  539. #                    pPageSetup -            
  540. #                                        0 - Don't do default PageSetup()
  541. #                                        1 - Do default PageSetup()
  542. #                                        list - list containing ordinality of 'Page Setup' menuItem.
  543. #                    pPrinter -             
  544. #                                        0 - Don't do default Printer()
  545. #                                        1 - Do default Printer()
  546. #                                        list - list containing ordinality of 'Print' menuItem. 
  547. #                    pQuit -                
  548. #                                        0 - Don't call Quit() Task 
  549. #                                        1 - Select 'Quit' - hard coded
  550. #                                        2 - KeyEq('q');
  551. #                                    {list}- ord or string path to Quit menuitem, i.e.
  552. #                                                {"Quit", "File"} or {17, 2}
  553. # Returns:            None
  554. #
  555. # Example:            DoCloseApp(1,2)
  556. #=======================================================================
  557. Calls:    gDoCloseAppHook1, DoFiles(), logstr(), gScriptBeginCriticalHook, AboutBox(), 
  558.         gScriptEndCriticalHook, PageSetup(), Printer(), gDoCloseAppHook2, 
  559.         SaveAs(), Quit(), gDoCloseAppHook3
  560. Is called by:    
  561.  
  562.  
  563.  
  564.  
  565.  
  566.  
  567.  
  568.  
  569.  
  570. ##############################################################
  571. ##############################################################
  572. ##############################################################
  573. Library: Draw.Lib
  574. Calls: "Palette.Lib", "String.Lib","OutPut.lib", "TCS.Lib", "Geometry.Lib",
  575. "UserInterface.Lib", "ExceptionHandling.Lib"
  576.  
  577.  
  578. Task:    InitDraw()
  579. Library:    Draw.Lib
  580. Header:
  581. #########################################################################
  582. #                        InitDraw()
  583. #========================================================================
  584. # Author:        KTA
  585. # Description:    Initializes the Draw globals. 
  586. # Parameters:    None
  587. # Returns:        Nada
  588. # Examples:        InitDraw();
  589. # Assumptions:    
  590. #========================================================================
  591. Calls:
  592. Is called by:    
  593.  
  594.  
  595. Task:    CheckObjectStruct(pObjectStruct)
  596. Library:    Draw.Lib
  597. Header:
  598. #########################################################################
  599. #            CheckObjectStruct(pObjectStruct)
  600. #========================================================================
  601. # Author:        KTA
  602. # Description:    Check validity of elements in pObjectStruct.
  603. # Parameters:    pObjectStruct -     the objectStruct to check
  604. # Returns:        0 - objectStruct is hosed
  605. #                1 - objectStruct is OK
  606. # Example:    returnVal := CheckObjectStruct(pObjectStruct);
  607. #========================================================================
  608. Calls:    GetElemStruct(), GetElemType(), GetElemName(), GetElemDblClk(), 
  609.         GetPointList(), GetLine(), GetColor(), GetPattern(), 
  610. Is called by:    DrawObject()
  611.  
  612.  
  613. Task:    DrawObject(pObjectStruct := {}, pSpecifier := 0)
  614. Library:    Draw.Lib
  615. Header:
  616. #########################################################################
  617. #                DrawObject(pObjectStruct, pSpecifier)
  618. #========================================================================
  619. # Author:        DMM / KTA
  620. # Description:    Main routine in the Draw Libraries.  Calls all subroutines
  621. #                necessary to draw a given object, passing the appropriate 
  622. #                elements from the pObjectStruct input param.
  623. # Parameters:    pObjectStruct :=     {
  624. #                                    {ToolStruct},
  625. #                                    {PointList},
  626. #                                    {PatternStruct}, 
  627. #                                    {LineStruct},
  628. #                                    {ColorStruct}
  629. #                                    };
  630. #                pSpecifier - Specifies the window (or Rect) to draw in)
  631. # Returns:        1 - exercises went OK
  632. #                0 - error in drawing object
  633. # Examples:    noError := DrawObject(objectStruct,specifier);
  634. # DrawObject({global SelectTool, {{25,15}}, {12,2 ,’Pattern’}, 0, ‘Random’});
  635. #========================================================================
  636. Calls:    MouseSpeed(), GetElemStruct(), InsertElemStruct(), GetPalNum(), GetElemType(), 
  637.         GetElemName(), GetElemDblClk(), GetElemNum(), GetSetAttribute(), SetPointList(), 
  638.         InsertPointList(), CheckObjectStruct(), PalettePicker(), SetTool(), 
  639.         InsertPattern(), InsertColor(), InsertLine(), SetAttributes(), PointListToStr(), 
  640.         LogStr(), UseClickTool(), UseDragTool(), UseDragClickTool(), UseMultiDragTool(), 
  641.         UseMultiClickTool(), UseMultiClickDragTool(), UseDragOffTool(), TCSStart(), 
  642.         DialogCheck(), TCSEnd(), gDrawObjectHook
  643. Is called by:    DoDraw(), Draw(), 
  644.  
  645.  
  646. Task:    SetAttributes(pObjectStruct, pDrawObject)
  647. Library:    Draw.Lib
  648. Header:
  649. #########################################################################
  650. #                SetAttributes(pObjectStruct,pDrawObject)
  651. #========================================================================
  652. # Author:        KTA
  653. # Description:    This task takes a complete objectStruct as a parameter, it will
  654. #                determine if the tool being used to draw with can set various
  655. #                attributes (patterns, lines, and colors).  If so the appropriate
  656. #                tasks will be called and the actual attribute structs used will
  657. #                be inserted into the objectStruct prior to returning.
  658. # Parameters:    pObjectStruct - a complete objectStruct - note some elements will
  659. #                                evaluate to 0 or random upon entry - the random 
  660. #                                elements will be replaced with actual atribute  
  661. #                                struct prior to exiting. Elements that are 0 will
  662. #                                not be set.
  663. #                pDrawObject -     This is the number that is used to tie together
  664. #                                all elements that make up an object for TCS  
  665. #                                logging purposes.
  666. # Returns:    pObjectStruct  - Setting attributes went OK
  667. #            0 - error in - Setting attributes
  668. # Examples:    
  669. #========================================================================
  670. Calls:    GetElemStruct(), SetObjectAttribute(), 
  671. Is called by:    DrawObject(), 
  672.  
  673.  
  674. Task:    SetObjectAttribute(pObjectStruct, pElemStruct, pDrawObject, pFlagTask,
  675.                         pGetAttributeTask, pSetAttributeTask, pInsertAttributeTask,
  676.                         pAttributeName)
  677. Library:    Draw.Lib
  678. Header:
  679. #########################################################################
  680. #                SetObjectAttribute(pObjectStruct,pDrawObject)
  681. #========================================================================
  682. # Author:        ML
  683. # Description:    Sets an objects attribute and returns the updated object structure.
  684. # Parameters:    pObjectStruct - a complete objectStruct - note some elements will
  685. #                                evaluate to 0 or random upon entry - the random 
  686. #                                elements will be replaced with actual atribute  
  687. #                                struct prior to exiting. Elements that are 0 will
  688. #                                not be set.
  689. #                pDrawObject -     This is the number that is used to tie together
  690. #                                all elements that make up an object for TCS  
  691. #                                logging purposes.
  692. # Returns:    pObjectStruct  - Setting attributes went OK
  693. #            0 - error in - Setting attributes
  694. # Examples:    
  695. #========================================================================
  696. Calls:    pFlagTask, pGetAttributeTask, pSetAttributeTask, pInsertAttributeTask, 
  697.     #### NB: This task calls the task references passed to it.
  698. Is called by:    SetAttributes()
  699.  
  700.  
  701. Task:    UseClickTool(pPointList, pSpecifier)
  702. Library:    Draw.Lib
  703. Header:
  704. #########################################################################
  705. #                            UseClickTool()
  706. #========================================================================
  707. # Author:        DMM 
  708. # Description:    Move to point and click once.
  709. # Parameters:    pPointList - List containing a point.
  710. #                pSpecifier - Window specifier for the window to move relative to.
  711. # Returns:        1 - Clicked
  712. # Examples:        UseClickTool();
  713. # Assumptions:    None 
  714. #========================================================================
  715. Calls:    TCSStart(), MoveRelativeToWindow(), TCSEnd()
  716. Is called by:    DrawObject()
  717.  
  718.  
  719. Task:    UseDragTool(pPointList:= {}, pSpecifier := 0, pMouseDown := 6, 
  720.         pDClickToEnd := 0)
  721. Library:    Draw.Lib
  722. Header:
  723. #########################################################################
  724. #            UseDragTool(pPointList, pSpecifier, pMouseDown, pDClickToEnd)
  725. #========================================================================
  726. # Author:        DMM 
  727. # Description:    Drag from the current location.
  728. # Parameters:    pPointList - Point to move to.
  729. #                pSpecifier - Window specifier in which to drag in.
  730. #                pMouseDown - 0 - don't hold mouse key down while moving
  731. #                            1 - press mouse key down - move - release
  732. #                            2 - Click after moving - no mouse down during move
  733. #                            3 - press mouse key down - move - don't release
  734. #                            4 - move - release
  735. #                pDClickToEnd - Boolean flag indicating whether or not to double
  736. #                                click the mouse after dragging.
  737. # Returns:        returnVal - what moveRelativeToWindow returns.
  738. # Examples:        UseDragTool({{100,200},{200,200}}, 0, 1,0);
  739. # Assumptions:    All points are specified relative to window.
  740. #========================================================================
  741. Calls:    TCSStart(), MoveRelativeToWindow(), _doubleClick(), TCSEnd()
  742. Is called by:    DrawObject()
  743.  
  744.  
  745. Task:    UseDragClickTool(pPointList:= {}, pSpecifier := 0, pMouseDown := 1, 
  746.         pDClickToEnd := 0)
  747. Library:    Draw.Lib
  748. Header:
  749. #########################################################################
  750. #    UseDragClickTool(pPointList, pSpecifier, pMouseDown, pDClickToEnd)
  751. #========================================================================
  752. # Author:        KTA 
  753. # Description:    Drag from the current location. Then click at a different point.
  754. # Parameters:    pPointList - List of points to move to.
  755. #                pSpecifier - Window specifier in which to drag in.
  756. #                pMouseDown - 0 - don't hold mouse key down while moving
  757. #                            1 - press mouse key down - move - release
  758. #                            2 - Click after moving - no mouse down during move
  759. #                            3 - press mouse key down - move - don't release
  760. #                            4 - move - release
  761. #                pDClickToEnd - Boolean flag indicating whether or not to double
  762. #                                click the mouse after dragging.
  763. # Returns:        returnVal - what MoveRelativeToWindow returns.
  764. # Examples:        UseDragClickTool({{100,200},{100,200}, {200,300}},0,1,0);
  765. # Assumptions:    All points are specified relative to window.
  766. #========================================================================
  767. Calls:    TCSStart(), MoveRelativeToWindow(), _doubleClick(), TCSEnd()
  768. Is called by:    DrawObject()
  769.  
  770.  
  771. Task:    UseMultiDragTool(pPointList := {}, pSpecifier := 0, pDClickToEnd := 0)
  772. Library:    Draw.Lib
  773. Header:
  774. #########################################################################
  775. #            UseMultiDragTool(pPointList, pSpecifier, pDClickToEnd)
  776. #========================================================================
  777. # Author:        DMM 
  778. # Description:    mouseDown-drag-drag-drag-drag-release.
  779. # Parameters:    pPointList - List of points to move to.
  780. #                pSpecifier - Window specifier in which to drag in.
  781. #                pDClickToEnd - Boolean flag indicating whether or not to double
  782. #                                click the mouse after dragging.
  783. # Returns:        returnVal - what MoveRelativeToWindow returns.
  784. # Examples:        UseMultiDragTool({{100,200}, {200,300}},0,0);
  785. # Assumptions:    All points are specified relative to window.
  786. #========================================================================
  787. Calls:    TCSStart(), MoveRelativeToWindow(), _doubleClick(), TCSEnd()
  788. Is called by:    DrawObject()
  789.  
  790.  
  791. Task:    TASK UseMultiClickTool(pPointList, pSpecifier := 0, pDClickToEnd := 0) 
  792. Library:    Draw.Lib
  793. Header:
  794. #########################################################################
  795. #        UseMultiClickTool(pPointList, pSpecifier, pDClickToEnd)
  796. #========================================================================
  797. # Author:        DMM 
  798. # Description:    click-move-click-move….
  799. # Parameters:    pPointList - List of points to move to.
  800. #                pSpecifier - Window specifier in which to drag in.
  801. #                pDClickToEnd - Boolean flag indicating whether or not to double
  802. #                                click the mouse after dragging.
  803. # Returns:        returnVal - what MoveRelativeToWindow returns.
  804. # Examples:        UseMultiClickTool({{100,200}, {200,300}},0,0);
  805. # Assumptions:    All points are specified relative to window.
  806. #========================================================================
  807. Calls:    TCSStart(), MoveRelativeToWindow(), _doubleClick(), TCSEnd()
  808. Is called by:    DrawObject()
  809.  
  810.  
  811. Task:    UseMultiClickDragTool(pPointList, pSpecifier := 0, pDClickToEnd := 0)
  812. Library:    Draw.Lib
  813. Header:
  814. #########################################################################
  815. #    UseMultiClickDragTool(pPointList, pSpecifier, pDClickToEnd)
  816. #========================================================================
  817. # Author:        KTA 
  818. # Description:    mouseDown-drag-mouseUp-mouseDown-drag-mouseUp….
  819. # Parameters:    pPointList - List of points to move to.
  820. #                pSpecifier - Window specifier in which to drag in.
  821. #                pDClickToEnd - Boolean flag indicating whether or not to double
  822. #                                click the mouse after dragging.
  823. # Returns:        Nothing
  824. # Examples:        UseMultiClickDragTool();
  825. # Assumptions:    All points are
  826. #                 specified relative to window.
  827. #========================================================================
  828. Calls:    TCSStart(), MoveRelativeToWindow(), _doubleClick(), TCSEnd()
  829. Is called by:    DrawObject()
  830.  
  831.  
  832. Task:    UseDragOffTool(pPointList:= {}, pSpecifier := 0, pMouseDown := 1, 
  833.         pDClickToEnd := 0) 
  834. Library:    Draw.Lib
  835. Header:
  836. #########################################################################
  837. #            UseDragOffTool(pPointList, pSpecifier, pMouseDown, pDClickToEnd)
  838. #========================================================================
  839. # Author:        KTA 
  840. # Description:    Drag Tool into the content region of the window.
  841. # Parameters:    pPointList - Point to move to.
  842. #                pSpecifier - Window specifier in which to drag in.
  843. #                pMouseDown - 0 - don't hold mouse key down while moving
  844. #                            1 - press mouse key down - move - release
  845. #                            2 - Click after moving - no mouse down during move
  846. #                            3 - press mouse key down - move - don't release
  847. #                            4 - move - release
  848. #                pDClickToEnd - Boolean flag indicating whether or not to double
  849. #                                click the mouse after dragging.
  850. # Returns:        returnVal - what moveRelativeToWindow returns.
  851. # Examples:        UseDragOffTool({{100,200}}, 0, 1,0);
  852. # Assumptions:    All points are specified relative to window.
  853. #========================================================================
  854. Calls:    TCSStart(), MoveRelativeToWindow(), _doubleClick(), TCSEnd()
  855. Is called by:    DrawObject()
  856.  
  857.  
  858. Task:    GetElemStruct()
  859.         GetPointList()
  860.         GetPattern()
  861.         GetLine()
  862.         GetColor()
  863.         GetGradient()
  864.         GetBackgroundColor()
  865.         GetTextColor()
  866.         GetPenPattern()
  867.         
  868.         InsertElemStruct()
  869.         InsertPointList()
  870.         InsertPattern()
  871.         InsertLine()
  872.         InsertColor()
  873.         InsertGradient()
  874.         InsertBackgroundColor()
  875.         InsertTextColor()
  876.         InsertPenPattern()
  877. Library:    Draw.Lib
  878. Header:
  879. #########################################################################
  880. #                            Object Structure Accessors()
  881. #========================================================================
  882. # Author:        DMM 
  883. # Description:    These functions access the data in an objectStruct data 
  884. #                structure.
  885. # Parameters:    objectStruct
  886. # Returns:        the requested data element or list
  887. #========================================================================
  888. Calls:
  889. Is called by:    Draw.Lib routines
  890.  
  891.  
  892. Task:    MakePointList(pInset :={ 0,0,20,20 } , pSpecifier := 0, 
  893.         pNumPoints := global gNumPoints,  pClosed := 0, pVoidRect := {} )
  894. Library:    Draw.Lib
  895. Header:
  896. #########################################################################
  897. #        MakePointList( pInset, pSpecifier, pNumPoints, pClosed, pVoidRect )
  898. #========================================================================
  899. # Author:        DMM
  900. # Description:    Generates a list of random points 
  901. # Parameters:    pInset -     inset into window for ppoints to be generated.
  902. #                pSpecifier - Window specifier for the window to generate points in.
  903. #                pNumPoints -    number of points to comprise the object
  904. #                pClosed     -     1 for closed object (first-last point the same)
  905. #                            0 for open object (first-last point different)
  906. #                pVoidRect - no points in object should be in this rectangle 
  907. # Returns:        List of Points.
  908. # Examples:        theObject := MakePointList(rect);    # 4 point closed object
  909. #                theObject := MakePointList(theWindow.r, 4,1,thePalette.r);
  910. #========================================================================
  911. Calls:    GetRandomPointsRelativeToWindow(), PtInRect(), 
  912. Is called by:    SetPointList()
  913.  
  914.  
  915. Task:    SetTool(pTool := 'Random', pSelectTool := 1, pObjectNumber := 0)
  916. Library:    Draw.Lib
  917. Header:
  918. #########################################################################
  919. #                    SetTool(pTool,pSelectTool, pObjectNumber)
  920. #========================================================================
  921. # Author:        KTA 
  922. # Description:    This task takes a ToolStruct as a parameter. If the ToolStruct
  923. #                evaluates to 'Random' a ToolStruct will be generated randomly.
  924. #                If the pSelectTool evaluates to true the tool will also be selected.
  925. #                Otherwise, the generated toolStruct will be returned without 
  926. #                selecting the tool. 
  927. # Parameters:    pTool - 0 - nothing done return 0
  928. #                        - Valid ToolStruct
  929. #                        - 'Random' - generates a random ToolStruct
  930. #                pSelectTool - Boolean flag which indicates whether or not to 
  931. #                            select the tool.
  932. #                pObjectNumber - Integer used to track all elements that make up 
  933. #                                an object - TCS related.
  934. # Returns:        0 - nothing done 0 passed in.
  935. #                Valid toolStruct 
  936. # Assumptions:    All draw related data structures set up properly.
  937. #========================================================================
  938. Calls:    PalettePicker()
  939. Is called by:    DrawObject(), GenerateObject()
  940.  
  941.  
  942. Task:    GenerateObject(pTheObject := {'Random','Random','Random','Random','Random'}) 
  943. Library:    Draw.Lib
  944. Header:
  945. #########################################################################
  946. #                        GenerateObject(pTheObject)
  947. #========================================================================
  948. # Author:        KTA
  949. # Description:    This task generates valid elements for any element that evaluates
  950. #                to 'Random'. 
  951. # Parameters:    pTheObject - A complete Object Struct.  The default is to 
  952. #                            generate all elements of the returned object
  953. #                            randomly. Passing in partially completed object
  954. #                            struct will replace the elements which evaluate
  955. #                            to 'Random' with valid data.
  956. # Returns:        pTheObject - a complete objectStruct no elements will evaluate
  957. #                            to 'Random'
  958. # Examples:        GenerateObject({global PointerTool,'Random',0,'Random','Random'})
  959. # Assumptions:    All the necessary Draw Structs have been defined correctly.
  960. #========================================================================
  961. Calls:    GetElemStruct(), SetTool(), InsertElemStruct(), GetPointList(), SetPointList(), 
  962.         InsertPointList(), GetPattern(), SetPattern(), InsertPattern(), GetLine(), 
  963.         SetLine(), InsertLine(), GetColor(), SetColor(), InsertColor()
  964. Is called by:    
  965.  
  966.  
  967. Task:    SetPointList(pTheObject, pSpecifier := 0)
  968. Library:    Draw.Lib
  969. Header:
  970. #########################################################################
  971. #                        SetPointList(pTheObject, pSpecifier)
  972. #========================================================================
  973. # Author:        KTA 
  974. # Description:    Determines the number of points required for a given tool type.
  975. #                Then calls MakePointList() to generate pointlist for different
  976. #                tool types.
  977. #                    kClick tools - require a single point.
  978. #                    kDrag tools - require a two points.
  979. #                    All multipoint tools - access the global gNumPoints to 
  980. #                        determine the number of points.
  981. # Parameters:    pTheObject - a complete objectStruct with atleast a valid
  982. #                            ToolStruct. 
  983. #                pSpecifier - Specifier of the window in which to generate 
  984. #                             points in.
  985. # Returns:        thePointList - a list of point within <pSpecifier>
  986. # Examples:        SetPointList(TheObjectStruct, 0);
  987. # Assumptions:    All the necessary Draw Structs have been defined correctly.
  988. #========================================================================
  989. Calls:    GetElemStruct(), GetPointList(), GetElemType(), MakePointList()
  990. Is called by:    DrawObject(), GenerateObject(), 
  991.  
  992.  
  993. Task:    Draw(pTheTool := 'Random', pThePointList := 'Random', pThePattern := 'Random',
  994.             pTheLine := 'Random', pTheColor := 'Random', pSpecifier := 0,
  995.             pGradient := 'Random', pBGColor := 'Random', pTextColor := 'Random',
  996.             pPenPat := 'Random')
  997. Library:    Draw.Lib
  998. Header:
  999. #########################################################################
  1000. #    Draw(pTheTool, pThePointList, pThePattern, pTheLine, pTheColor, pSpecifier )
  1001. #========================================================================
  1002. # Author:        KTA
  1003. # Description:    This task provides a means for defining any of the elements
  1004. #                within an ObjectStruct and allowing the libraries to generate
  1005. #                any element that evaluates to 'Random' (default for all elements)
  1006. # Parameters:    1 parameter for each of the elements of an objectStruct and 
  1007. #                1 additional parameter for the window pSpecifier.
  1008. #                    pTheTool - ToolStruct
  1009. #                    pThePointList - PointList (not user definable at this time)
  1010. #                    pThePattern - PatternStruct
  1011. #                    pTheLine - LineStruct
  1012. #                    pTheColor - ColorStruct
  1013. #                    pSpecifier - Window or rect to draw in 
  1014. # Returns:        The actual ObjectStruct after generating 'Random' elements.
  1015. # Examples:        Draw(Global SelectTool, ‘Random’,0,0,{14,3, ‘Color’})
  1016. # Assumptions:    All the necessary Draw Structs have been defined correctly.
  1017. #========================================================================
  1018. Calls:    RandomDrawObject(), InsertElemStruct(), InsertPointList(), InsertPattern(), 
  1019.         InsertLine(), InsertColor(), InsertGradient(), InsertBackgroundColor(), 
  1020.         InsertTextColor(), InsertPenPattern(), DrawObject()
  1021. Is called by:    
  1022.  
  1023.  
  1024. Task:    SetColor(pTheColor := 'Random', pSelectColor := 1, pObjectNumber := 0)
  1025. Library:    Draw.Lib
  1026. Header:
  1027. #########################################################################
  1028. #                SetColor(pTheColor, pSelectColor, pObjectNumber)
  1029. #========================================================================
  1030. # Author:        KTA
  1031. # Description:    This is used when selecting colors from a palette.This task
  1032. #                takes a ColorStruct as a parameter. If the ColorStruct evaluates
  1033. #                to 'Random' a ColorStruct will be generated randomly.
  1034. #                If the pSelectColor evaluates to true the color will also be selected.
  1035. #                Otherwise, the generated ColorStruct will be returned without 
  1036. #                selecting the color.  
  1037. # Parameters:    pTheColor - 0 - nothing done return 0
  1038. #                        - Valid ColorStruct
  1039. #                        - 'Random' - generates a random ColorStruct
  1040. #                pSelectColor - Boolean flag which indicates whether or not to 
  1041. #                            select the Color.
  1042. #                pObjectNumber - Integer used to track all elements that make up 
  1043. #                                an object - TCS related.
  1044. # Returns:        colStruct - A valid ColorStruct
  1045. # Examples:        SetColor('Random', 1, 14);
  1046. # Assumptions:    All draw related data structures set up properly.
  1047. #========================================================================
  1048. Calls:    SetPaletteItem()
  1049. Is called by:    GenerateObject()
  1050.  
  1051.  
  1052. Task:    SetLine(pTheLine := 'Random', pSelectLine := 1, pObjectNumber := 0)
  1053. Library:    Draw.Lib
  1054. Header:
  1055. #########################################################################
  1056. #                    SetLine(pTheLine, pSelectLine, pObjectNumber)
  1057. #========================================================================
  1058. # Author:        KTA
  1059. # Description:    This is used when selecting line weights from a palette. 
  1060. #                This task takes a LineStruct as a parameter. If the LineStruct
  1061. #                evaluates to 'Random' a LineStruct will be generated randomly.
  1062. #                If the pSelectLine evaluates to true the line will also be selected.
  1063. #                Otherwise, the generated LineStruct will be returned without 
  1064. #                selecting the line weight.
  1065. # Parameters:    pTheLine - 0 - nothing done return 0
  1066. #                        - Valid LineStruct
  1067. #                        - 'Random' - generates a random LineStruct
  1068. #                pSelectLine - Boolean flag which indicates whether or not to 
  1069. #                            select the line.
  1070. #                pObjectNumber - Integer used to track all elements that make up 
  1071. #                                an object - TCS related.
  1072. # Returns:        LineStruct - A valid LineStruct
  1073. # Examples:        SetLine('Random', 1, 14);
  1074. # Assumptions:    All draw related data structures set up properly.
  1075. #========================================================================
  1076. Calls:    SetPaletteItem()
  1077. Is called by:    GenerateObject()
  1078.  
  1079.  
  1080. Task:    SetLineMenuItems(pTheLine := {}, pSelectLine := 1,  pObjectNumber := 0)
  1081. Library:    Draw.Lib
  1082. Header:
  1083. #########################################################################
  1084. #                    SetLineMenuItems(pTheLine, pSelectLine, pObjectNumber)
  1085. #========================================================================
  1086. # Author:        KTA
  1087. # Description:    This is used when selecting line weights from menuItems. 
  1088. #                This task takes a LineStruct as a parameter. If the LineStruct
  1089. #                evaluates to 'Random' a LineStruct will be generated randomly.
  1090. #                If the ppSelectLine evaluates to true the tool will also be selected.
  1091. #                Otherwise, the generated LineStruct will be returned without 
  1092. #                selecting the line weight.  This task depends upon a global
  1093. #                gLineWeights to be defined as the menuItem titles of the menuitems
  1094. #                which are used to set line wieghts.
  1095. # Parameters:    pTheLine - 0 - nothing done return 0
  1096. #                        - Valid LineStruct
  1097. #                        - 'Random' - generates a random LineStruct
  1098. #                pSelectLine - Boolean flag which indicates whether or not to 
  1099. #                            select the line.
  1100. #                pObjectNumber - Integer used to track all elements that make up 
  1101. #                                an object - TCS related.
  1102. # Returns:        LineStruct - A valid LineStruct
  1103. # Examples:        SetLine('Random', 1, 14);
  1104. # Assumptions:    All draw related data structures set up properly.
  1105. #========================================================================
  1106. Calls:    TCSStart(), SelectMenuItem(), LogStr(), TCSEnd()
  1107. Is called by:    
  1108.  
  1109.  
  1110. Task:    SetPattern(pThePattern := 'Random', pSelectPattern := 1, pObjectNumber := 0)
  1111. Library:    Draw.Lib
  1112. Header:
  1113. #########################################################################
  1114. #            SetPattern(pThePattern, pSelectPattern, pObjectNumber)
  1115. #========================================================================
  1116. # Author:        KTA
  1117. # Description:    This is used when selecting patterns from a palette. 
  1118. #                This task takes a PatternStruct as a parameter. If the PatternStruct
  1119. #                evaluates to 'Random' a PatternStruct will be generated randomly.
  1120. #                If the pSelectPattern evaluates to true the pattern will also be selected.
  1121. #                Otherwise, the generated PatternStruct will be returned without 
  1122. #                selecting the pattern.
  1123. # Parameters:    pThePattern - 0 - nothing done return 0
  1124. #                            - Valid PatternStruct
  1125. #                            - 'Random' - generates a random PatternStruct
  1126. #                pSelectPattern - Boolean flag which indicates whether or not to 
  1127. #                            select the pattern.
  1128. #                pObjectNumber - Integer used to track all elements that make up 
  1129. #                                an object - TCS related.
  1130. # Returns:        patStruct - A valid PatternStruct
  1131. # Examples:        SetPattern('Random', 1, 14);
  1132. # Assumptions:    All draw related data structures set up properly.
  1133. #========================================================================
  1134. Calls:    SetPaletteItem()
  1135. Is called by:    GenerateObject()
  1136.  
  1137.  
  1138. Task:    SetBackgroundColor(pBackgroundColor := 'Random', pSelectItem := 1,
  1139.                             pObjectNumber := 0)    
  1140. Library:    Draw.Lib
  1141. Header:
  1142. #########################################################################
  1143. #            SetBackgroundColor(pBackgroundColor, pSelectItem, pObjectNumber)
  1144. #========================================================================
  1145. # Author:        ML
  1146. # Description:    This is used when selecting Background Colors from a palette. 
  1147. #                This task takes an element struct, item number, or "Random"
  1148. #                as a parameter.  If 'Random', an element struct will be generated randomly.
  1149. #                If pSelectItem evaluates to true the element struct
  1150. #                will also be selected.
  1151. # Parameters:    pBackgroundColor    - 0 - nothing done return 0
  1152. #                                    - Valid Item Num
  1153. #                                    - valid element struct
  1154. #                                    - 'Random' - generates a random element struct
  1155. #                pSelectItem - Boolean flag which indicates whether or not to 
  1156. #                            select the element.
  1157. #                pObjectNumber - Integer used to track all elements that make up 
  1158. #                                an object - TCS related.
  1159. # Returns:        BackgroundColorStruct - A valid BackgroundColorStruct
  1160. # Examples:        SetBackgroundColor('Random', 1, 14);
  1161. # Assumptions:    All draw related data structures set up properly.
  1162. #========================================================================
  1163. Calls:    SetPaletteItem()
  1164. Is called by:    
  1165.  
  1166.  
  1167. Task:    SetTextColor(pTextColor := 'Random', pSelectItem := 1,
  1168.                             pObjectNumber := 0)
  1169. Library:    Draw.Lib
  1170. Header:
  1171. #########################################################################
  1172. #            SetTextColor(pTextColor, pSelectItem, pObjectNumber)
  1173. #========================================================================
  1174. # Author:        ML
  1175. # Description:    This is used when selecting Text Colors from a palette. 
  1176. #                This task takes an element struct, item number, or "Random"
  1177. #                as a parameter.  If 'Random', an element struct will be generated randomly.
  1178. #                If pSelectItem evaluates to true the element struct
  1179. #                will also be selected.
  1180. # Parameters:    pTextColor    - 0 - nothing done return 0
  1181. #                                    - Valid Item Num
  1182. #                                    - valid element struct
  1183. #                                    - 'Random' - generates a random element struct
  1184. #                pSelectItem - Boolean flag which indicates whether or not to 
  1185. #                            select the element.
  1186. #                pObjectNumber - Integer used to track all elements that make up 
  1187. #                                an object - TCS related.
  1188. # Returns:        TextColorStruct - A valid TextColorStruct
  1189. # Examples:        SetTextColor('Random', 1, 14);
  1190. # Assumptions:    All draw related data structures set up properly.
  1191. #========================================================================
  1192. Calls:    SetPaletteItem()
  1193. Is called by:    
  1194.  
  1195.  
  1196. Task:    SetPenPattern(pPenPattern := 'Random', pSelectItem := 1,
  1197.                             pObjectNumber := 0)
  1198. Library:    Draw.Lib
  1199. Header:
  1200. #########################################################################
  1201. #            SetPenPattern(pPenPattern, pSelectItem, pObjectNumber)
  1202. #========================================================================
  1203. # Author:        ML
  1204. # Description:    This is used when selecting pen patterns from a palette. 
  1205. #                This task takes an element struct, item number, or "Random"
  1206. #                as a parameter.  If 'Random', an element struct will be generated randomly.
  1207. #                If pSelectItem evaluates to true the element struct
  1208. #                will also be selected.
  1209. # Parameters:    pPenPattern    - 0 - nothing done return 0
  1210. #                                    - Valid Item Num
  1211. #                                    - valid element struct
  1212. #                                    - 'Random' - generates a random element struct
  1213. #                pSelectItem - Boolean flag which indicates whether or not to 
  1214. #                            select the element.
  1215. #                pObjectNumber - Integer used to track all elements that make up 
  1216. #                                an object - TCS related.
  1217. # Returns:        PenPatternStruct - A valid PenPatternStruct
  1218. # Examples:        SetPenPattern('Random', 1, 14);
  1219. # Assumptions:    All draw related data structures set up properly.
  1220. #========================================================================
  1221. Calls:    SetPaletteItem()
  1222. Is called by:    
  1223.  
  1224.  
  1225. Task:    SetGradient(pGradient := 'Random', pSelectItem := 1,
  1226.                             pObjectNumber := 0)    
  1227. Library:    Draw.Lib
  1228. Header:
  1229. #########################################################################
  1230. #            SetGradient(pGradient, pSelectItem, pObjectNumber)
  1231. #========================================================================
  1232. # Author:        ML
  1233. # Description:    This is used when selecting gradients from a palette. 
  1234. #                This task takes an element struct, item number, or "Random"
  1235. #                as a parameter.  If 'Random', an element struct will be generated randomly.
  1236. #                If pSelectItem evaluates to true the element struct
  1237. #                will also be selected.
  1238. # Parameters:    pGradient    - 0 - nothing done return 0
  1239. #                                    - Valid Item Num
  1240. #                                    - valid element struct
  1241. #                                    - 'Random' - generates a random element struct
  1242. #                pSelectItem - Boolean flag which indicates whether or not to 
  1243. #                            select the element.
  1244. #                pObjectNumber - Integer used to track all elements that make up 
  1245. #                                an object - TCS related.
  1246. # Returns:        GradientStruct - A valid GradientStruct
  1247. # Examples:        SetGradient('Random', 1, 14);
  1248. # Assumptions:    All draw related data structures set up properly.
  1249. #========================================================================
  1250. Calls:    SetPaletteItem()
  1251. Is called by:    
  1252.  
  1253.  
  1254. Task:    SetPaletteItem(pPaletteItem := 'Random', pSelectItem := 1, pPaletteName:= "",
  1255.                     pPaletteNum:= 0, pObjectNumber := 0)
  1256. Library:    Draw.Lib
  1257. Header:
  1258. #########################################################################
  1259. #            SetPaletteItem(pThePattern, pSelectPattern, pObjectNumber)
  1260. #========================================================================
  1261. # Author:        ML
  1262. # Description:    This is used when selecting an item from a palette. 
  1263. #                This task takes a palette item number as a parameter. If the palette item number
  1264. #                evaluates to 'Random' a palette item struct will be generated randomly.
  1265. #                If the pSelectPattern evaluates to true the palette item will also be selected.
  1266. #                Otherwise, the generated palette item struct will be returned without 
  1267. #                selecting the palette item.
  1268. # Parameters:    pPaletteItem - 0 - nothing done return 0
  1269. #                                - Valid Palette Item Num
  1270. #                                - valid Palette item struct
  1271. #                                - 'Random' - generates a random palette item struct
  1272. #                pSelectItem - Boolean flag which indicates whether or not to 
  1273. #                                select the palette item.
  1274. #                pPaletteName - string describing the name of the palette
  1275. #                pPaletteNum - the palette's position within the global gPaletteList
  1276. #                pObjectNumber - Integer used to track all elements that make up 
  1277. #                                an object - TCS related.
  1278. # Returns:        ItemStruct - A valid palette item struct
  1279. # Examples:        SetPaletteItem({ 8,3,"pattern" },0, "pattern", global kPatternPaletteNum);
  1280. # Assumptions:    All draw related data structures set up properly.
  1281. #========================================================================
  1282. Calls:    GetRandomElement(), PalettePicker()
  1283. Is called by:    SetColor(), SetLine(), SetPattern(), SetBackgroundColor(), 
  1284.                 SetTextColor(), SetPenPattern(), SetGradient(), 
  1285.  
  1286.  
  1287. Task:    CheckSetup()
  1288. Library:    Draw.Lib
  1289. Header:
  1290. #########################################################################
  1291. #                    CheckSetup()
  1292. #========================================================================
  1293. # Author:        KTA
  1294. # Description:    Reports the current state of various draw related
  1295. #                globals and global structures.  Call this task after a script    
  1296. #                has defined all of its draw related globals.  This routine will 
  1297. #                print the current setting.  A review of the output could help
  1298. #                to reveal any problems with the initial setup.
  1299. # Parameters:    none
  1300. # Returns:        nothing
  1301. # Examples:        CheckSetup();
  1302. #========================================================================
  1303. Calls:    PalettePicker(), 
  1304. Is called by:    
  1305.  
  1306.  
  1307. Task:    RandomDrawObject()
  1308. Library:    Draw.Lib
  1309. Header:
  1310. #########################################################################
  1311. #                    RandomDrawObject()
  1312. #========================================================================
  1313. # Author:        ML
  1314. # Description:    Generate a draw object with 'random' for all items.
  1315. # Parameters:    none
  1316. # Returns:        a draw object with 'random' for all items
  1317. # Examples:        RandomDrawObject();
  1318. #========================================================================
  1319. Calls:
  1320. Is called by:    Draw()
  1321.  
  1322.  
  1323.  
  1324.  
  1325.  
  1326.  
  1327.  
  1328.  
  1329. ##############################################################
  1330. ##############################################################
  1331. ##############################################################
  1332. Library: ExceptionHandling.lib
  1333. Calls: 
  1334.  
  1335.  
  1336. Task:    AddExceptionHandler(pExceptionCode, pExceptionHandler)
  1337. Library:    ExceptionHandling.lib
  1338. Header:
  1339. #########################################################################
  1340. #                AddExceptionHandler(pTheErrorList)
  1341. #========================================================================
  1342. #    Description:    pushes error list onto the global error handling stack
  1343. #    Parameters:        pExceptionCode - (string, integer, List)
  1344. #                            The code to identify the exception
  1345. #                    pExceptionHandler - {list}
  1346. #                            the Handler in the form: {Task reference,{Parameters} ThrowFlag}
  1347. #    Returns:        true if it worked, false if not
  1348. #    Examples:        AddExceptionHandler(-1100, {TASK crashRecover,{ "TeachText",1,5 },1});
  1349. #    Assumptions:    none
  1350. #========================================================================
  1351. Calls:
  1352. Is called by:    
  1353.  
  1354.  
  1355. Task:    RemoveExceptionHandler(pTheError)
  1356. Library:    ExceptionHandling.lib
  1357. Header:
  1358. #########################################################################
  1359. #                RemoveExceptionHandler(pTheError)
  1360. #========================================================================
  1361. #    Description:    pop first instance of pTheError off the global error handling stack
  1362. #    Parameters:        pTheError
  1363. #    Returns:        true if it worked, false if not
  1364. #    Examples:        RemoveExceptionHandler(-1100);
  1365. #    Assumptions:    none
  1366. #========================================================================
  1367. Calls:
  1368. Is called by:    
  1369.  
  1370.  
  1371. Task:    SpecialHandlers(pErrorCode, pHanderList)
  1372. Library:    ExceptionHandling.lib
  1373. Header:
  1374. #########################################################################
  1375. #                SpecialHandlers()
  1376. #========================================================================
  1377. #    Description:    
  1378. #    Parameters:        
  1379. #    Returns:        true if it worked, false if not
  1380. #    Examples:        SpecialHandlers(-);
  1381. #    Assumptions:    none
  1382. #========================================================================
  1383. Calls:
  1384. Is called by:    ExceptionDispatcher()
  1385.  
  1386.  
  1387. Task:    ExceptionDispatcher(pErrorCode, pHandleTheError:= 0, pErrorContext := {})
  1388. Library:    ExceptionHandling.lib
  1389. Header:
  1390. #########################################################################
  1391. #                ExceptionDispatcher(pErrorCode, pHandleTheError)
  1392. #========================================================================
  1393. #    Description:    A mechanism for handling errors
  1394. #    Parameters:        pErrorCode:    The error code
  1395. #    Returns:        result of error handler TASK call, or throw if fatal
  1396. #    Examples:        ExceptionDispatcher(-1100)
  1397. #    Assumptions:    VU 2.1, also needs a list of error codes/handlers defined in
  1398. #                    global gExceptionHandlerList in the form:
  1399. #                            {     {
  1400. #                                ErrCode,                 # Error Code
  1401. #                                    {
  1402. #                                    Handler,             # TASK reference
  1403. #                                    {Parameters},        # List of Parameters
  1404. #                                    ThrowFlag            # Flag indicating whether you want errors 
  1405. #                                    }                    #  with this code to be thrown
  1406. #                                }, …
  1407. #                            };
  1408. #========================================================================
  1409. Calls:    gExceptionDispatcherHook, SpecialHandlers()
  1410. Is called by:    DA.Lib, _Match(), _MatchBoolean(), _Select(), _SelectBoolean(), 
  1411.                 _Drag(), _Size(), _Close(), _Zoom(), _Scroll(), _Type(), 
  1412.                 _PressKey(), _ReleaseKey(), _Move(), _Click(), _DoubleClick(), 
  1413.                 _PressMouse(), _ReleaseMouse(), _Launch(), _Collect(), 
  1414.                 _Gestalt(), _DebugStr(), FileToolOperations.Lib, Geometry.lib, 
  1415.                 IvyOperations.Lib, LaunchQuit.Lib, MemoryMonitorOperations.Lib, 
  1416.                 OnTargetOperations.Lib, Select.Lib, StandardFile.Lib, 
  1417.                 TargetCheck.Lib, TCS.Lib, TimingBasics.Lib, TimingOperations.lib, 
  1418.                 UserInterface.Lib, WorldReady.Lib
  1419.  
  1420.  
  1421. Task:    DefaultExceptionHandler(pErrID, pParamList)
  1422. Library:    ExceptionHandling.lib
  1423. Header:
  1424. #########################################################################
  1425. #                DefaultExceptionHandler(pErrID, pParamList)
  1426. #========================================================================
  1427. #    Description:    Simple exception Handler that just prints the error code
  1428. #                    and the list of parameters.  We may add more as soon as 
  1429. #                    we figure out what functionality to add.
  1430. #    Parameters:        pErrID: the error code
  1431. #                    pParamList:    list of parameters
  1432. #    Returns:        1
  1433. #    Examples:        DefaultExceptionHandler({"param1", 2, {'param3'}})
  1434. #    Assumptions:    VU 2.1
  1435. #========================================================================
  1436. Calls:
  1437. Is called by:    ExceptionDispatcher()
  1438.  
  1439.  
  1440. Task:    _Match(pDescriptor := [target], pExactFlag := 0)
  1441. Library:    ExceptionHandling.lib
  1442. Header:
  1443. #########################################################################
  1444. #                _Match(pDescriptor, pExactFlag)
  1445. #========================================================================
  1446. #    Description:    Error checking prototype for descriptor matching
  1447. #    Parameters:        pTheDesc:    the descriptor to match, always looks for exact
  1448. #                                (don't include '!')
  1449. #    Returns:        0 - couldn't match
  1450. #                    1 - successful match
  1451. #    Examples:        _Match([window o:1]);
  1452. #    Assumptions:    VU 2.1
  1453. #========================================================================
  1454. Calls:    ExceptionDispatcher()
  1455. Is called by:    SetFont(), SetStyle(), SetSize(), Twitcher(), MiniLaunch(), 
  1456.                 LaunchTwitch(), PageSetup(), Printer(), IsStandardFile(), 
  1457.                 ApplicationVerification(), CheckforSystemFailure(), 
  1458.                 ScrollWindow(), SwitchScript()
  1459.  
  1460.  
  1461. Task:    _MatchBoolean(pDescriptor := [target], pExactFlag := true)
  1462. Library:    ExceptionHandling.lib
  1463. Header:
  1464. #########################################################################
  1465. #                _MatchBoolean(pTheDesc)
  1466. #========================================================================
  1467. #    Description:    Error checking prototype for descriptor matching
  1468. #    Parameters:        pTheDesc:    the descriptor to match, always looks for exact
  1469. #                                (don't include '!')
  1470. #    Returns:        0 - couldn't match
  1471. #                    1 - successful match
  1472. #    Examples:        _MatchBoolean([window o:1]);
  1473. #    Assumptions:    VU 2.1
  1474. #========================================================================
  1475. Calls:    ExceptionDispatcher()
  1476. Is called by:    DefaultCrashHandler(), ReacquireTarget(), Twitcher(), MiniLaunch(), 
  1477.                 Quit(), QuitBackgroundApps(), LaunchAssist(), LaunchByTypeSelect(), 
  1478.                 LaunchTwitch(), SaveAs(), SFType(), IsStandardFile(), 
  1479.                 CancelStandardFile(), Restart(), DragAcrossScreens(), 
  1480.                 SizeAcrossScreens(), DialogCheck(), DialogDismisser(), 
  1481.                 WhichLanguageResources(), WhichMenuIsKeyBoardMenu()
  1482.  
  1483.  
  1484. Task:    _Select(pDescriptor := [target], pExactFlag := 0)
  1485. Library:    ExceptionHandling.lib
  1486. Header:
  1487. #########################################################################
  1488. #                _Select(pTheDesc)
  1489. #========================================================================
  1490. #    Description:    Error checking prototype for descriptor selecting
  1491. #    Parameters:        pTheDesc:    the descriptor to select
  1492. #    Returns:        0 - couldn't match
  1493. #                    1 - successful match
  1494. #    Examples:        _Select([window o:1]);
  1495. #    Assumptions:    VU 2.1
  1496. #========================================================================
  1497. Calls:    ExceptionDispatcher()
  1498. Is called by:    MiniLaunch(), Restart(), Twitcher(), SelectMenuItem(), 
  1499.                 SelectPopUpMenuItem(), SelectWindow(), SelectRadioButton(), 
  1500.                 SelectCheckBox(), WhichScript(), SwitchScript()
  1501.  
  1502.  
  1503. Task:    _SelectBoolean(pDescriptor := [target], pExactFlag := true)
  1504. Library:    ExceptionHandling.lib
  1505. Header:
  1506. #########################################################################
  1507. #                _SelectBoolean(pTheDesc)
  1508. #========================================================================
  1509. #    Description:    Error checking prototype for descriptor matching
  1510. #    Parameters:        pTheDesc:    the descriptor to select, always looks for exact
  1511. #                                (don't include '!')
  1512. #    Returns:        0 - couldn't select
  1513. #                    1 - successful select
  1514. #    Examples:        _SelectBoolean([menuitem t:"Open" m: [menu t:"File"]]);
  1515. #    Assumptions:    VU 2.1
  1516. #========================================================================
  1517. Calls:    ExceptionDispatcher()
  1518. Is called by:    
  1519.  
  1520.  
  1521. Task:    _Drag(pDescriptor := [target], pHow := 'a', pCoords := {}, pExactFlag := 0)
  1522. Library:    ExceptionHandling.lib
  1523. Header:
  1524. #########################################################################
  1525. #                _Drag(pTheDesc)
  1526. #========================================================================
  1527. #    Description:    Error checking prototype for descriptor selecting
  1528. #    Parameters:        pTheDesc:    the descriptor to select
  1529. #    Returns:        0 - couldn't match
  1530. #                    1 - successful match
  1531. #    Examples:        _Drag([window o:1]);
  1532. #    Assumptions:    VU 2.1
  1533. #========================================================================
  1534. Calls:    ExceptionDispatcher()
  1535. Is called by:    DragWindow()
  1536.  
  1537.  
  1538. Task:    _Size(pWindowDesc := [window o:1], pHow := 'wh', pCoords := {}, pExactFlag := 0)
  1539. Library:    ExceptionHandling.lib
  1540. Header:
  1541. #########################################################################
  1542. #                _Size(pTheDesc)
  1543. #========================================================================
  1544. #    Description:    Error checking prototype for descriptor selecting
  1545. #    Parameters:        pWindowDesc:    the window descriptor to select
  1546. #                    pHow:    how to size
  1547. #                        r - relative
  1548. #                        w - width only
  1549. #                        h - height only
  1550. #                        wh - both width and height
  1551. #                    pCoords:  list of coord(s).  Single element list if pHow is
  1552. #                              w or h, two element list (width, height) if r or wh.
  1553. #    Returns:        0 - couldn't match
  1554. #                    1 - successful match
  1555. #    Examples:        _Size([window o:1]);
  1556. #    Assumptions:    VU 2.1
  1557. #========================================================================
  1558. Calls:    ExceptionDispatcher()
  1559. Is called by:    
  1560.  
  1561.  
  1562. Task:    _Close(pDescriptor := [], pExactFlag := 0)
  1563. Library:    ExceptionHandling.lib
  1564. Header:
  1565. #########################################################################
  1566. #                _Close(pDescriptor, pExactFlag)
  1567. #========================================================================
  1568. #    Description:    Error checking prototype for descriptor matching
  1569. #    Parameters:        pTheDesc:    the descriptor to match, always looks for exact
  1570. #                                (don't include '!')
  1571. #    Returns:        0 - couldn't match
  1572. #                    1 - successful match
  1573. #    Examples:        _Close([window o:1]);
  1574. #    Assumptions:    VU 2.1
  1575. #========================================================================
  1576. Calls:    ExceptionDispatcher()
  1577. Is called by:    CloseWindow()
  1578.  
  1579.  
  1580. Task:    _Zoom(pDescriptor := [], pExactFlag := 0)
  1581. Library:    ExceptionHandling.lib
  1582. Header:
  1583. #########################################################################
  1584. #                _Zoom(pDescriptor, pExactFlag)
  1585. #========================================================================
  1586. #    Description:    Error checking prototype for descriptor matching
  1587. #    Parameters:        pTheDesc:    the descriptor to match, always looks for exact
  1588. #                                (don't include '!')
  1589. #    Returns:        0 - couldn't match
  1590. #                    1 - successful match
  1591. #    Examples:        _Zoom([window o:1]);
  1592. #    Assumptions:    VU 2.1
  1593. #========================================================================
  1594. Calls:    ExceptionDispatcher()
  1595. Is called by:    
  1596.  
  1597.  
  1598. Task:    _Scroll(pDescriptor := [target], pHow := 'a', pCoords := {}, pExactFlag := 0)
  1599. Library:    ExceptionHandling.lib
  1600. Header:
  1601. #########################################################################
  1602. #                _Scroll(pTheDesc)
  1603. #========================================================================
  1604. #    Description:    Error checking prototype for descriptor selecting
  1605. #    Parameters:        pTheDesc:    the descriptor to select
  1606. #    Returns:        0 - couldn't match
  1607. #                    1 - successful match
  1608. #    Examples:        _Scroll([window o:1]);
  1609. #    Assumptions:    VU 2.1
  1610. #========================================================================
  1611. Calls:    ExceptionDispatcher()
  1612. Is called by:    Scrapbook()
  1613.  
  1614.  
  1615. Task:    _Type(pKeyList := {}, pCodeList := {}, pPad := 0, pKeyStrokesFirst := 1)
  1616. Library:    ExceptionHandling.lib
  1617. Header:
  1618. #########################################################################
  1619. #                _Type(pTheDesc)
  1620. #========================================================================
  1621. #    Description:    Error checking prototype for descriptor selecting
  1622. #    Parameters:        pTheDesc:    the descriptor to select
  1623. #    Returns:        0 - couldn't match
  1624. #                    1 - successful match
  1625. #    Examples:        _Scroll([window o:1]);
  1626. #    Assumptions:    VU 2.1
  1627. #========================================================================
  1628. Calls:    ExceptionDispatcher()
  1629. Is called by:    PageSize(), SFType(), ReplaceExist(), TypeWord(), TypeSentence(), 
  1630.                 TypeParagraph(), KeyEq(), TypeStr(), TypeList(), SpecialKey(), 
  1631.                 SwitchScript(), TypeEnglishText(), TypeJapaneseString(), 
  1632.                 TypeSimplifiedChineseString(), TypeTradChineseString()
  1633.  
  1634.  
  1635. Task:    _PressKey(pKeyList := {}, pCodeList := {}, pPad := 0)
  1636. Library:    ExceptionHandling.lib
  1637. Header:
  1638. #########################################################################
  1639. #                _PressKey(pTheDesc)
  1640. #========================================================================
  1641. #    Description:    Error checking prototype for descriptor selecting
  1642. #    Parameters:        pTheDesc:    the descriptor to select
  1643. #    Returns:        0 - couldn't match
  1644. #                    1 - successful match
  1645. #    Examples:        _PressKey([window o:1]);
  1646. #    Assumptions:    VU 2.1
  1647. #========================================================================
  1648. Calls:    ExceptionDispatcher()
  1649. Is called by:    HereToStartSelect(), HereToEndSelect(), SelectAll(), 
  1650.                 RandomTextSelection(), KeyEq(), SwitchScript(), 
  1651.                 TypeSimplifiedChineseString(), TypeTradChineseString()
  1652.  
  1653.  
  1654. Task:    _ReleaseKey(pKeyList := {}, pCodeList := {}, pPad := 0)
  1655. Library:    ExceptionHandling.lib
  1656. Header:
  1657. #########################################################################
  1658. #                _ReleaseKey(pTheDesc)
  1659. #========================================================================
  1660. #    Description:    Error checking prototype for descriptor selecting
  1661. #    Parameters:        pTheDesc:    the descriptor to select
  1662. #    Returns:        0 - couldn't match
  1663. #                    1 - successful match
  1664. #    Examples:        _ReleaseKey([window o:1]);
  1665. #    Assumptions:    VU 2.1
  1666. #========================================================================
  1667. Calls:    ExceptionDispatcher()
  1668. Is called by:    HereToStartSelect(), HereToEndSelect(), SelectAll(), 
  1669.                 RandomTextSelection(), KeyEq(), SwitchScript(), 
  1670.                 TypeSimplifiedChineseString(), TypeTradChineseString()
  1671.  
  1672.  
  1673. Task:    _Move(pHow := 'a', pCoords := {})
  1674. Library:    ExceptionHandling.lib
  1675. Header:
  1676. #########################################################################
  1677. #                _Move(pTheDesc)
  1678. #========================================================================
  1679. #    Description:    Error checking prototype for descriptor selecting
  1680. #    Parameters:        pTheDesc:    the descriptor to select
  1681. #    Returns:        0 - couldn't match
  1682. #                    1 - successful match
  1683. #    Examples:        _Move([window o:1]);
  1684. #    Assumptions:    VU 2.1
  1685. #========================================================================
  1686. Calls:    ExceptionDispatcher()
  1687. Is called by:    SFSelectPopupMenuItem(), PerformScroll(), SelectButton(), 
  1688.                 MoveMouse(), 
  1689.  
  1690.  
  1691. Task:    _Click()
  1692. Library:    ExceptionHandling.lib
  1693. Header:
  1694. #########################################################################
  1695. #                _Click(pTheDesc)
  1696. #========================================================================
  1697. #    Description:    Error checking prototype for descriptor selecting
  1698. #    Parameters:        pTheDesc:    the descriptor to select
  1699. #    Returns:        0 - couldn't match
  1700. #                    1 - successful match
  1701. #    Examples:        _Click([window o:1]);
  1702. #    Assumptions:    VU 2.1
  1703. #========================================================================
  1704. Calls:    ExceptionDispatcher()
  1705. Is called by:    RectSelect(), HereToStartSelect(), HereToEndSelect(), SelectAll(), 
  1706.                 SelectButton(), MoveMouse()
  1707.  
  1708.  
  1709. Task:    _DoubleClick()
  1710. Library:    ExceptionHandling.lib
  1711. Header:
  1712. #########################################################################
  1713. #                _DoubleClick(pTheDesc)
  1714. #========================================================================
  1715. #    Description:    Error checking prototype for descriptor selecting
  1716. #    Parameters:        pTheDesc:    the descriptor to select
  1717. #    Returns:        0 - couldn't match
  1718. #                    1 - successful match
  1719. #    Examples:        _DoubleClick([window o:1]);
  1720. #    Assumptions:    VU 2.1
  1721. #========================================================================
  1722. Calls:    ExceptionDispatcher()
  1723. Is called by:    UseDragTool(), UseDragClickTool(), UseMultiDragTool(), 
  1724.                 UseMultiClickTool(), UseMultiClickDragTool(), UseDragOffTool()
  1725.  
  1726.  
  1727. Task:    _PressMouse()
  1728. Library:    ExceptionHandling.lib
  1729. Header:
  1730. #########################################################################
  1731. #                _PressMouse(pTheDesc)
  1732. #========================================================================
  1733. #    Description:    Error checking prototype for descriptor selecting
  1734. #    Parameters:        pTheDesc:    the descriptor to select
  1735. #    Returns:        0 - couldn't match
  1736. #                    1 - successful match
  1737. #    Examples:        _PressMouse([window o:1]);
  1738. #    Assumptions:    VU 2.1
  1739. #========================================================================
  1740. Calls:    ExceptionDispatcher()
  1741. Is called by:    SelFromPopUp(), SelFromMenuItemPopUp(), SFSelectPopupMenuItem(), 
  1742.                 PerformScroll(), MoveMouse()
  1743.  
  1744.  
  1745. Task:    _ReleaseMouse()
  1746. Library:    ExceptionHandling.lib
  1747. Header:
  1748. #########################################################################
  1749. #                _ReleaseMouse(pTheDesc)
  1750. #========================================================================
  1751. #    Description:    Error checking prototype for descriptor selecting
  1752. #    Parameters:        pTheDesc:    the descriptor to select
  1753. #    Returns:        0 - couldn't match
  1754. #                    1 - successful match
  1755. #    Examples:        _ReleaseMouse([window o:1]);
  1756. #    Assumptions:    VU 2.1
  1757. #========================================================================
  1758. Calls:    ExceptionDispatcher()
  1759. Is called by:    SelFromPopUp(), SelFromMenuItemPopUp(), SFSelectPopupMenuItem(), 
  1760.                 PerformScroll(), MoveMouse()
  1761.  
  1762.  
  1763. Task:    _Launch(pApplication := '', pOntarget := TRUE)
  1764. Library:    ExceptionHandling.lib
  1765. Header:
  1766. #########################################################################
  1767. #                _Launch(pTheDesc)
  1768. #========================================================================
  1769. #    Description:    Error checking prototype for descriptor selecting
  1770. #    Parameters:        pTheDesc:    the descriptor to select
  1771. #    Returns:        0 - couldn't match
  1772. #                    1 - successful match
  1773. #    Examples:        _Launch([window o:1]);
  1774. #    Assumptions:    VU 2.1
  1775. #========================================================================
  1776. Calls:    ExceptionDispatcher()
  1777. Is called by:    
  1778.  
  1779.  
  1780. Task:    _Collect(pDescriptor := [target], pExactFlag := 0)
  1781. Library:    ExceptionHandling.lib
  1782. Header:
  1783. #########################################################################
  1784. #                _Collect(pDescriptor, pExactFlag)
  1785. #========================================================================
  1786. #    Description:    Error checking prototype for descriptor matching
  1787. #    Parameters:        pTheDesc:    the descriptor to match, always looks for exact
  1788. #                                (don't include '!')
  1789. #    Returns:        0 - couldn't match
  1790. #                    1 - successful match
  1791. #    Examples:        _Collect([window o:1]);
  1792. #    Assumptions:    VU 2.1
  1793. #========================================================================
  1794. Calls:    ExceptionDispatcher()
  1795. Is called by:    ReportSelectedMenuItems(), PrintAlert(), SaveAs(), ReplaceExist(), 
  1796.                 IsStandardFile(), Restart(), RecordMonitorInfo(), TestWindow(), 
  1797.                 AdjustRectToScreen(), GetVHScrollBars(), FindWindow(), 
  1798.                 DialogCheck(), WhichScript()
  1799.  
  1800.  
  1801. Task:    _Gestalt(pSelector)
  1802. Library:    ExceptionHandling.lib
  1803. Header:
  1804. #########################################################################
  1805. #                _Gestalt(pSelector)
  1806. #========================================================================
  1807. #    Description:    Error checking for gestalt
  1808. #    Parameters:        pSelector:    gestalt selector
  1809. #    Returns:        0 - unsuccesful gestalt call
  1810. #                    {list} - gestalt result
  1811. #    Examples:        _Gestalt('sysv');
  1812. #    Assumptions:    VU 2.1
  1813. #========================================================================
  1814. Calls:    ExceptionDispatcher()
  1815. Is called by:    Check32Bit(), CheckVM(), GestaltFPUType(), GestaltMachineType(), 
  1816.                 GestaltProcessorType(), GestaltMMUType(), GestaltLogicalRAMSize(), 
  1817.                 GestaltPhysicalRAMSize(), GestaltSystemArchitecture(), 
  1818.                 MachineState(), IsSystem7()
  1819.  
  1820.  
  1821.  
  1822. Task:    _DebugStr(pTheString, pAtSystemTaskTime := false)
  1823. Library:    ExceptionHandling.lib
  1824. Header:
  1825. #########################################################################
  1826. #                _DebugStr(pTheString, pAtSystemTaskTime)
  1827. #========================================================================
  1828. #    Description:    Invokes our exceptionHandling mechanism for the DebugStr call.
  1829. #    Parameters:        pTheString:    debug string e.g. ';ht'
  1830. #                    pAtSystemTaskTime - indicate interupt or systemTask time
  1831. #    Returns:        nothing
  1832. #    Examples:        _DebugStr(';ht;g');
  1833. #    Assumptions:    VU 2.1
  1834. #========================================================================
  1835. Calls:    ExceptionDispatcher()
  1836. Is called by:    InstallEveryTimeMacro(), 
  1837.  
  1838.  
  1839.  
  1840.  
  1841.  
  1842.  
  1843.  
  1844.  
  1845.  
  1846. ##############################################################
  1847. ##############################################################
  1848. ##############################################################
  1849. Library: FileToolOperations.Lib
  1850. Calls: "FileTool.vuLib", "Output.Lib", "String.Lib", "ExceptionHandling.Lib"
  1851.  
  1852.  
  1853. Task:    _FileTool(pServiceOrTask, pParamList := {}, pOnTarget := true, 
  1854.         pIsRetry := 0)
  1855. Library:    FileToolOperations.Lib
  1856. Header:
  1857. #########################################################################
  1858. #        _FileTool(pOnTheTarget := true)
  1859. #========================================================================
  1860. # Author:        KTA 
  1861. # Description:    Does the exception handling for the Filetool.  All high level tasks
  1862. #                should call this routine for file tool services or tasks within the
  1863. #                FileTool.vulib.  Handles initialization of tool automatically.
  1864. # Parameters:    pServiceorTask - Name of the Service or task
  1865. #                pParamList - List of parameters
  1866. #                pOnTarget - Flag to indicate whether the service should be performed 
  1867. #                            the host or the target.  1 = target/0 = host.
  1868. # Returns:        What ever the file tool returns - list of three elements
  1869. #                            { errCode, Data, [error message]}
  1870. # Examples:        _FileTool('ReadUntil', {'HD:FileName'},1);
  1871. # Assumptions:    None 
  1872. #========================================================================
  1873. Calls:    FileTool(), ExceptionDispatcher(), _FileTool()
  1874. Is called by:    GatherTargetCrashLog(), InstallEveryTimeMacro(), _FileTool(), 
  1875.                 InitFileTool(), QuitFileTool(), ReadTheLine(), ExistsOrCreate(), 
  1876.                 MoveTheFile(), DoesFileExist(), PathToSpecialFolder(), 
  1877.                 NameOfBootVolume(), DeleteTheFile(), CopyFileToPath(), 
  1878.                 ProfileApplication()
  1879.  
  1880.  
  1881. Task:    InitFileTool(pOnTheTarget := true)
  1882. Library:    FileToolOperations.Lib
  1883. Header:
  1884. #########################################################################
  1885. #        InitFileTool(pOnTheTarget := true)
  1886. #========================================================================
  1887. # Author:        KTA 
  1888. # Description:    Initializes the FileTool 
  1889. # Parameters:    pOnTheTarget - True if you want to launch the FileTool on  
  1890. #                                the target machine. False if on the Host.
  1891. # Returns:        0 - Couldn't initialize
  1892. #                1 - Init On Target
  1893. #                2 - Init On Host
  1894. # Examples:        InitFileTool();
  1895. # Assumptions:    None 
  1896. #========================================================================
  1897. Calls:    _FileTool(), 
  1898. Is called by:    
  1899.  
  1900.  
  1901. Task:    QuitFileTool(pOnTheTarget := true)
  1902. Library:    FileToolOperations.Lib
  1903. Header:
  1904. #########################################################################
  1905. #        QuitFileTool()
  1906. #========================================================================
  1907. # Author:        KTA 
  1908. # Description:    Quits the FileTool 
  1909. # Parameters:    none
  1910. # Returns:        0 - Couldn't Quit
  1911. #                1 - Quit Successfully
  1912. # Examples:        QuitFileTool();
  1913. # Assumptions:    None 
  1914. #========================================================================
  1915. Calls:    _FileTool(), 
  1916. Is called by:    InstallEveryTimeMacro(), GatherTargetCrashLog()
  1917.  
  1918.  
  1919. Task:    ReadTheLine( pFileReference, pFromPosition := 0, pOnTarget := true )
  1920. Library:    FileToolOperations.Lib
  1921. Header:
  1922. #########################################################################
  1923. #        ReadTheLine( pFileReference, pFromPosition )
  1924. #========================================================================
  1925. # Author:        KTA 
  1926. # Description:    Similar to ReadLine in ?FileTool.vulib except this routine does the error
  1927. #                checking and will return 0 if an error occur otherwise it will 
  1928. #                what the line that was read (2nd element of what theFileTool returned)
  1929. # Parameters:    pFileReference - File to read from.  
  1930. #                pFromPosition - position to begin reading from.
  1931. # Returns:        0 - Some Error
  1932. #                String - line read
  1933. # Examples:        ReadTheLine('hd:myFile', 0);
  1934. # Assumptions:    None 
  1935. #========================================================================
  1936. Calls:    _Filetool
  1937. Is called by:    
  1938.  
  1939.  
  1940. Task:    ExistsOrCreate(pFileName, pOnTarget := true )
  1941. Library:    FileToolOperations.Lib
  1942. Header:
  1943. #########################################################################
  1944. #                        ExistsOrCreate()
  1945. #========================================================================
  1946. # Author:        KTA
  1947. # Description:    Checks to see if the <pFileName> exists - creates one if it does not.
  1948. # Parameters:    pFileName - full path of file
  1949. # Returns:        0 - Fail (doesn't exist, couldn't create)
  1950. #                1 - File Existed 
  1951. #                2 - Created File 
  1952. #                3 - Created Folder 
  1953. # Examples:        ExistsOrCreate();
  1954. # Assumptions:    None 
  1955. #========================================================================
  1956. Calls:    _FileTool(), 
  1957. Is called by:    GatherTargetCrashLog(), 
  1958.  
  1959.  
  1960. Task:    MoveTheFile(pSourcePath, pDestinationPath, pOnTarget := true )
  1961. Library:    FileToolOperations.Lib
  1962. Header:
  1963. #########################################################################
  1964. #                MoveTheFile(pSourcePath, pDestinationPath)
  1965. #========================================================================
  1966. # Author:        KTA 
  1967. # Description:    Moves Files from <pSourcePath> to <pDestinationPath>
  1968. #                
  1969. # Parameters:    pSourcePath - (String) Fullpath location of file to be moved. Should 
  1970. #                            be in the form: "HD:Folder:FileName".
  1971. #                pDestinationPath - (String) Fullpath location where file should be
  1972. #                                moved to. Should be in the form: "HD:Folder:FileName2" where 
  1973. #                                FileName2 is the new name for the file.
  1974. #                
  1975. # Returns:        0 - error occured
  1976. #                integer - file reference for file moved.
  1977. # Assumptions:     File exists in <pSourcePath> and <pDestinationPath> is a valid path.  
  1978. #                This routine does not check to see if either exist nor does it 
  1979. #                return errors if either is not found.
  1980. #========================================================================
  1981. Calls:    _FileTool(), LogStr()
  1982. Is called by:    
  1983.  
  1984.  
  1985. Task:    DoesFileExist(pFilePath := "", pOnTarget := true)
  1986. Library:    FileToolOperations.Lib
  1987. Header:
  1988. #########################################################################
  1989. #                        DoesFileExist(pFilePath)
  1990. #========================================================================
  1991. # Author:        KTA 
  1992. # Description:    This task checks to see if the file <pFilePath> exists.
  1993. # Parameters:    pFilePath - full path to a file.
  1994. # Returns:        0 - File does not exist.
  1995. #                1 - file exists
  1996. #========================================================================
  1997. Calls:    _FileTool()
  1998. Is called by:    InstallEveryTimeMacro(), CopyFileToPath()
  1999.  
  2000.  
  2001. Task:    PathToSpecialFolder(pSpecialFolder := '', pOnTarget := true)
  2002. Library:    FileToolOperations.Lib
  2003. Header:
  2004. #########################################################################
  2005. #                        PathToSpecialFolder()
  2006. #========================================================================
  2007. # Author:        KTA 
  2008. # Description:    Returns the path to the special folder.
  2009. # Parameters:    None
  2010. # Returns:        0 - error occured
  2011. #                string - full path to system folder in following format:
  2012. #                "hd:Systemfolder"
  2013. #    x := PathToSpecialFolder("extn" );
  2014. #    x := PathToSpecialFolder("ctrl" );
  2015. #    x := PathToSpecialFolder("macs" );
  2016. #========================================================================
  2017. Calls:    _FileTool()
  2018. Is called by:    InstallEveryTimeMacro(), CopyFileToPath()
  2019.  
  2020.  
  2021. Task:    NameOfBootVolume(pOnTarget := true)
  2022. Library:    FileToolOperations.Lib
  2023. Header:
  2024. #########################################################################
  2025. #                        NameOfBootVolume()
  2026. #========================================================================
  2027. # Author:        KTA 
  2028. # Description:    Returns the name of the boot volume
  2029. # Parameters:    None
  2030. # Returns:        0 - error occured
  2031. #                string - Name of the boot volume
  2032. #========================================================================
  2033. Calls:    _FileTool()
  2034. Is called by:    InstallEveryTimeMacro(), 
  2035.  
  2036.  
  2037. Task:    DeleteTheFile(pFileName, pOnTarget := true)
  2038. Library:    FileToolOperations.Lib
  2039. Header:
  2040. #########################################################################
  2041. #                        DeleteTheFile(pFileName)
  2042. #========================================================================
  2043. # Author:        KTA 
  2044. # Description:    Deletes the file <pFileName>
  2045. # Parameters:    pFileName - full path to the file to be deleted.
  2046. # Returns:        0 - error occured
  2047. #                1 - file was deleted properly
  2048. #========================================================================
  2049. Calls:    _FileTool()
  2050. Is called by:    GatherTargetCrashLog()
  2051.  
  2052.  
  2053. Task:    CopyFileToPath(pFileToCopy := '', pDestinationPath := 'SystemFolder')
  2054. Library:    FileToolOperations.Lib
  2055. Header:
  2056. #########################################################################
  2057. #                CopyFileToPath(pFileToCopy,pDestinationPath)
  2058. #========================================================================
  2059. # Author:        KTA 
  2060. # Description:    Copies the file <pFileToCopy> to the directory specified by 
  2061. #                the input parameter <pDestinationPath>.
  2062. #                Folder. This must be the full path of the file not just the filename.
  2063. # Parameters:    pFileToCopy - Full path to source file in the form: "hd:fileName"
  2064. # Returns:        0 - error occured
  2065. #                1 - file was copied properly
  2066. #========================================================================
  2067. Calls:    DoesFileExist(), NumTimesCharInString(), StringAfterChar(), _FileTool()
  2068. Is called by:    
  2069.  
  2070.  
  2071.  
  2072.  
  2073.  
  2074.  
  2075.  
  2076.  
  2077.  
  2078.  
  2079. ##############################################################
  2080. ##############################################################
  2081. ##############################################################
  2082. Library: Finder.Lib
  2083. Calls: "Output.Lib", "LaunchQuit.Lib", "StandardFile.Lib","UserInterface.Lib"
  2084.  
  2085.  
  2086. Task:    HelpBalloons( n := 2 )
  2087. Library:    Finder.Lib
  2088. Header:
  2089. #########################################################################
  2090. #                    HelpBalloons( n )
  2091. #========================================================================
  2092. # Author:        KTA
  2093. # Description:    Turns Help Balloons ON/OFF
  2094. # Parameters:    0 - To turn Help Balloons - OFF
  2095. #                1 - To turn Help Balloons - ON
  2096. #                2 - To toggle the Hide Balloons/Show Balloons 
  2097. # Returns:        Nothing
  2098. # Examples:        HelpBalloons( 0 );
  2099. # Assumptions:    7.0x only!
  2100. #========================================================================
  2101. Calls:    LogStr()
  2102. Is called by:    
  2103.  
  2104.  
  2105. Task:    FinderNavigate(PathList := {},OpenFlag := 1)
  2106. Library:    Finder.Lib
  2107. Header:
  2108. #########################################################################
  2109. #            FinderNavigate( PathList, OpenFlag )    
  2110. #========================================================================
  2111. # Author:        KTA 
  2112. # Description:    Navigates in the Finder by typing.  FinderNavigate insures
  2113. #                that Finder is the current app and closes all windows.
  2114. #                Then he types each item in Pathlist to select the next folder
  2115. #                and Command-'O' to open the selected folder.
  2116. # Parameters:    PathList := List of directories to open delimited by commas.
  2117. #                OpenFlag := Set to 1 to select Comand-'O' for each directory
  2118. #                            in the Pathlist.  If this is not true than only
  2119. #                            the first item of pathlist will be typed. Use 0
  2120. #                            to navigate to disks on desktop without opening.
  2121. # Returns:        nada - No way to check - cross your fingers
  2122. # Examples:        FinderNavigate({"HD","Folder1","Folder2"};
  2123. # Assumptions:    Keyboard repeat rate must be off to type navigate successfully.
  2124. #========================================================================
  2125. Calls:    LaunchTwitch(), KeyEq(), TypeStr(), keyEq()
  2126. Is called by:    
  2127.  
  2128.  
  2129. Task:    ShimmerMateCopy(Source := {{},1}, Dest := {{},1}) 
  2130. Library:    Finder.Lib
  2131. Header:
  2132. #########################################################################
  2133. #                ShimmerMateCopy( Source, Dest )    
  2134. #========================================================================
  2135. # Author:        KTA 
  2136. # Description:    Opens ShimmerMate and copies the specified file from 
  2137. #                Source -> Destination.  (ShimmerMate is an internal 
  2138. #                Apple Tool for performing Finder operations using VU)
  2139. # Parameters:    Source[1] := Pathlist for source document 
  2140. #                Source[2] := Flag for Standard File navigation
  2141. #                Dest[1] := Pathlist for Destination including new unique document
  2142. #                           name.
  2143. #                Dest[2] := Flag for Standard File navigation
  2144. #                
  2145. #                Pathlist: List of directories followed by the filename 
  2146. #                          delimited by commas.
  2147. #                Flag:
  2148. #                    1 - Navigate using Standard File.
  2149. #                    0 - Type in path and filename delimited by ':'s.
  2150. # Returns:            0        :=    Failure
  2151. #                    1        :=    Success
  2152. # Example:        ShimmerMateCopy({{"HD","Folder1","MacPaint"},1},{{"My_Floppy","MacPaint"},0});
  2153. #                    - ShimmerMateCopy[1]; will use Standard  File
  2154. #                    - ShimmerMateCopy[2]; will type the path.
  2155. # Assumptions:    Shimmermate (or Alias) is in the Apple Menu.
  2156. #                Paths are correct.
  2157. #                There is room on the Destination disk (Shimmermate doesn't check)
  2158. #========================================================================
  2159. Calls:    Launchtwitch(), selectRadioButton(), LogStr(), SFNavigate(),
  2160.         SpecialKey(), TypeList(), selectButton(), 
  2161. Is called by:    
  2162.  
  2163.  
  2164.  
  2165.  
  2166.  
  2167.  
  2168.  
  2169.  
  2170.  
  2171.  
  2172. ##############################################################
  2173. ##############################################################
  2174. ##############################################################
  2175. Library: Font.Lib
  2176. Calls: "TCS.Lib","UserInterface.Lib", "OutPut.Lib", "ExceptionHandling.Lib";
  2177.  
  2178.  
  2179.  
  2180.  
  2181. Task:    ReplaceFont(pCurrentFont,pCurrentFontRecord)
  2182.         ReplaceFontSize(pCurrentSize,pCurrentFontRecord)
  2183.         ReplaceFontStyle(pStyleList,pCurrentFontRecord)
  2184. Library:    Font.Lib
  2185. Header:
  2186.     ##### Accessors ####
  2187. Calls:
  2188. Is called by:    RandomFontRecords(), WaterFallFontTest(), QuickLookTextTest()
  2189.  
  2190.  
  2191. Task:    TASK InitFonts()
  2192. Library:    Font.Lib
  2193. Header:
  2194. #########################################################################
  2195. #                        InitFonts()
  2196. #========================================================================
  2197. # Author:        KTA
  2198. # Description:    Initializes the font globals. 
  2199. # Parameters:    None
  2200. # Returns:        Nada
  2201. # Examples:        InitFonts();
  2202. # Assumptions:    
  2203. #========================================================================
  2204. Calls:
  2205. Is called by:    
  2206.  
  2207.  
  2208. Task:    SetFont(pMyFont := '', pObjectNumber := 'NA')
  2209. Library:    Font.Lib
  2210. Header:
  2211. #########################################################################
  2212. #                        SetFont(pMyFont, pObjectNumber)
  2213. #========================================================================
  2214. # Author:        KTA
  2215. # Description:    Selects <pMyFont> menuitem to set the current font.  
  2216. # Parameters:    pMyFont - Name of the font.
  2217. #                pObjectNumber - Integer used to track all elements that make up 
  2218. #                                an Font record - TCS related.
  2219. # Returns:        returns what SelectMenuItem returns 
  2220. #                    0 - failure
  2221. #                    String - success
  2222. # Examples:        SetFont('Geneva');
  2223. # Assumptions:    That InitFonts() has been called thus global gCurrFontMenu
  2224. #                is set to the name of the menus which contain <pMyFont>
  2225. #========================================================================
  2226. Calls:    FindMenu(), TCSStart(), SelectMenuItem(), _match(), TCSEnd(), LogStr()
  2227. Is called by:    Task assigned to global gSetFont in InitFonts() 
  2228.  
  2229.  
  2230. Task:    SetStyle(pMyStyle := '', pObjectNumber := 'NA')
  2231. Library:    Font.Lib
  2232. Header:
  2233. #########################################################################
  2234. #                        SetStyle(pMyStyle, pObjectNumber)
  2235. #========================================================================
  2236. # Author:        KTA
  2237. # Description:    Sets the currently selected font style to <pMyStyle> 
  2238. # Parameters:    pMyStyle - Name of the Style.
  2239. #                pObjectNumber - Integer used to track all elements that make up 
  2240. #                                an Font record - TCS related.
  2241. # Returns:        returns what SelectMenuItem returns 
  2242. #                    0 - failure
  2243. #                    String - success
  2244. # Examples:        SetStyle('Bold');
  2245. # Assumptions:    That InitFonts() has been called thus global gCurrStyleMenu
  2246. #                is set to the name of the menus which contain <pMyStyle>
  2247. #========================================================================
  2248. Calls:    FindMenu(), TCSStart(), SelectMenuItem(), _match(),  TCSEnd(), LogStr()
  2249. Is called by:    Task assigned to global gSetStyle in InitFonts()
  2250.  
  2251.  
  2252. Task:    SetSize(pMySize := '', pObjectNumber := 'NA')
  2253. Library:    Font.Lib
  2254. Header:
  2255. #########################################################################
  2256. #                        SetSize(pMySize, pObjectNumber)
  2257. #========================================================================
  2258. # Author:        KTA
  2259. # Description:    Sets the currently selected font size to <pMySize> 
  2260. # Parameters:    pMySize - Name of the size.
  2261. #                pObjectNumber - Integer used to track all elements that make up 
  2262. #                                an Font record - TCS related.
  2263. # Returns:        returns what SelectMenuItem returns 
  2264. #                    0 - failure
  2265. #                    String - success
  2266. # Examples:        SetSize('10');
  2267. # Assumptions:    That InitFonts() has been called thus global gCurrSizeMenu
  2268. #                is set to the name of the menus which contain <pMySize>
  2269. #========================================================================
  2270. Calls:    FindMenu(), TCSStart(), SelectMenuItem(), _match(),  TCSEnd(), LogStr()
  2271. Is called by:        Task assigned to global gSetSize in InitFonts()
  2272.  
  2273.  
  2274. Task:    NextLine()
  2275. Library:    Font.Lib
  2276. Header:
  2277. #########################################################################
  2278. #                        NextLine()
  2279. #========================================================================
  2280. # Author:        KTA
  2281. # Description:    Prepares application to accept the next line of text
  2282. # Parameters:    None
  2283. #                gNextLineMethod = 
  2284. #                    1 - ReturnKey
  2285. #                    2 - Enter Key
  2286. #                    3 - Down Arrow Key
  2287. #                    4 - Tab Key
  2288. #                    {<Optional Specifier>} - if no specifier will select the 
  2289. #                        first document window with close and grow box.
  2290. # Returns:        Nada
  2291. # Examples:        NextLine();
  2292. # Assumptions:    global gNextLineMethod is set to the correct method required for 
  2293. #                preparing the application to accept the next line of text.
  2294. #========================================================================
  2295. Calls:    SpecialKey(), MoveRelativeToWindow()
  2296. Is called by:    Task assigned to global gNextLine in InitFonts()
  2297.  
  2298.  
  2299. Task:    RandomFontRecords(pCurrentFontRecord := {"","",""})
  2300. Library:    Font.Lib
  2301. Header:
  2302. #########################################################################
  2303. #                        RandomFontRecords(pCurrentFontRecord)
  2304. #========================================================================
  2305. # Author:        KTA
  2306. # Description:    Creates random font records based on the globals: gFontList,
  2307. #                gFontSizeList, gFontStyleList. 
  2308. # Parameters:    pCurrentFontRecord - The script writer can define a partial record
  2309. #                                    and a complete record will be returned.
  2310. # Returns:        pCurrentFontRecord := {FontName, SizeName,{StyleName1, StyleName2}};
  2311. # Examples:        RandomFontRecords(); may return - {'Geneva','12'{'Bold','Italic'}}
  2312. # Assumptions:    
  2313. #========================================================================
  2314. Calls:    ReplaceFont(), ReplaceFontSize(), ReplaceFontStyle()
  2315. Is called by:    DoText(), TypeParagraph(), TimeFontTesting()
  2316.  
  2317.  
  2318. Task:    WaterFallFontTest()
  2319. Library:    Font.Lib
  2320. Header:
  2321. #########################################################################
  2322. #                        WaterFallFontTest()
  2323. #========================================================================
  2324. # Author:        KTA
  2325. # Description:    Creates and executes font records based on the globals: gFontList,
  2326. #                gFontSizeList, gFontStyleList. For each Font, each defined size will 
  2327. #                be selected, with each of the defined styles. 
  2328. # Parameters:    None
  2329. # Returns:        nada
  2330. # Examples:        WaterFallFontTest();
  2331. # Assumptions:    global gPlainStyle is defined as the Plain style menu item
  2332. #========================================================================
  2333. Calls:    ReplaceFont(), ReplaceFontSize(), ReplaceFontStyle(), SetFontParams(), 
  2334.         ReportSelectedMenuItems(), 
  2335. Is called by:    DoText()
  2336.  
  2337.  
  2338. Task:    QuickLookTextTest()
  2339. Library:    Font.Lib
  2340. Header:
  2341. #########################################################################
  2342. #                        QuickLookTextTest()
  2343. #========================================================================
  2344. # Author:        KTA
  2345. # Description:    Creates and executes font records based on the globals: gFontList,
  2346. #                gFontSizeList, gFontStyleList. For each Font will select 
  2347. #                random size and random number of styles.
  2348. # Parameters:    none
  2349. # Returns:        nada
  2350. # Examples:        QuickLookTextTest();
  2351. # Assumptions:    global gPlainStyle is defined as the Plain style menu item
  2352. #========================================================================
  2353. Calls:    ReplaceFont(), ReplaceFontSize(), ReplaceFontStyle(), SetFontParams()
  2354. Is called by:    
  2355.  
  2356.  
  2357. Task:    SetFontParams(pFontRecord,pResetPlainFlag := 1, pObjectNumber)
  2358. Library:    Font.Lib
  2359. Header:
  2360. #########################################################################
  2361. #                        SetFontParams(pFontRecord, pResetPlainFlag, pObjectNumber)
  2362. #========================================================================
  2363. # Author:        KTA
  2364. # Description:    Executes font records bycalling the routines necessary for  selecting 
  2365. #                the font (pFontRecord[1]) if its defined, selecting the size 
  2366. #                (pFontRecord[2]) if its defined, then selecting each style defined
  2367. #                in the styleRecord (pFontRecord[3]). ReportSelectedMenuItems is then
  2368. #                called to report all of the menu items in the appropriate menus 
  2369. #                with a MarkChar.
  2370. # Parameters:    pFontRecord- {Font,Size,{Style1,Style2}}
  2371. #                pResetPlainFlag - 
  2372. #                    1 - Select <gPlainStyle> before executing the StyleRecord
  2373. #                     loop so styles will begin at a cleared state.
  2374. #                    0 - Won't select the plain menu item.
  2375. #                pObjectNumber - Integer used to track all elements that make up 
  2376. #                                an Font record - TCS related.
  2377. # Returns:        By default,  returns what SetStyle returns 
  2378. # Examples:        SetFontParams();
  2379. # Assumptions:    global gPlainStyle is defined as the Plain style menu item
  2380. #========================================================================
  2381. Calls:    gSetFont, gSetSize, gSetStyle, gSetStyle
  2382. Is called by:    DoText(), WaterFallFontTest(), QuickLookTextTest(), TypeParagraph()
  2383.  
  2384.  
  2385. Task:    ReportSelectedMenuItems(pMenuList, pObjectNumber := '')
  2386. Library:    Font.Lib
  2387. Header:
  2388. #########################################################################
  2389. #                        ReportSelectedMenuItems(pMenuList, pObjectNumber)
  2390. #========================================================================
  2391. # Author:        KTA
  2392. # Description:    Collects all the menu items with a markChar ('') from the 
  2393. #                defined menus defined in pMenuList. Then types each marked item 
  2394. #                and calls NextLine() to move to the next text entry line.
  2395. # Parameters:    pMenuList - List of lists/strings 
  2396. #                    List of menus containing marked menuitems. 
  2397. #                pObjectNumber - Integer - used to track all elements that make up 
  2398. #                                an Font record - TCS related.
  2399. # Returns:        nada
  2400. # Examples:        ReportSelectedMenuItems({{'Format','Font'},{'Format','Styles'});
  2401. # Assumptions:    
  2402. #========================================================================
  2403. Calls:    gReportSelectedMenuItems, _collect(), TCSStart(), TypeStr(), 
  2404.         DialogCheck(), TCSEnd(), gNextLine
  2405. Is called by:    DoText(), WaterFallFontTest()
  2406.  
  2407.  
  2408.  
  2409.  
  2410.  
  2411.  
  2412.  
  2413.  
  2414.  
  2415. ##############################################################
  2416. ##############################################################
  2417. ##############################################################
  2418. Library: Geometry.lib
  2419. Calls: "ExceptionHandling.Lib";
  2420.  
  2421.  
  2422. Task:    PtInRect(thePoint,theRect)
  2423. Library:    Geometry.lib
  2424. Header:
  2425. #########################################################################
  2426. #                        PtInRect(thePoint,theRect)
  2427. #========================================================================
  2428. # Author:            NJV
  2429. # Description:        This routine determines whether or not thePoint 
  2430. #                    is contained within theRect (including borders). 
  2431. # Parameters:        thePoint - a list of two integers
  2432. #                    theRect - holds the coordinates of the rectangle.
  2433. # Returns:            true - point lies in the rectangle.
  2434. #                    false - point does NOT lie in the rectangle.
  2435. # Examples:            isIt := PtInRect(thePoint,theRect).
  2436. # Assumptions:        None
  2437. #========================================================================
  2438. Calls:
  2439. Is called by:    MakePointList() 
  2440.  
  2441.  
  2442. Task:    RndPtInWindow(specifier:= -1)
  2443. Library:    Geometry.lib
  2444. Header:
  2445. ########################################################################
  2446. #                        RndPtInWindow(specifier:=-1)
  2447. #=======================================================================
  2448. # Author:            NJV
  2449. # Description:        Returns a random point inside of the window.  If specifier
  2450. #                    is not passed, it will return a random point of the 
  2451. #                    content region of the first window with a grow and a
  2452. #                    zoom box, or if there are none, then the first window
  2453. #                    it finds, and if no windows are present, returns 0.
  2454. # Parameters:        specifier - title or ordinality of window
  2455. # Returns:            0 - couldn't find window
  2456. #                    Point -    list of 2 coordinates - {x,y}
  2457. # Examples:            thePoint := RndPtInWindow();    # get random point in window content
  2458. #                    thePoint := RndPtInWindow(1);    # random point in window ordinality 1
  2459. #=======================================================================
  2460. Calls:    RndPtInRect(), _match()
  2461. Is called by:    
  2462.  
  2463.  
  2464. Task:    RndPtInRect(theRect:=-1)
  2465. Library:    Geometry.lib
  2466. Header:
  2467. ########################################################################
  2468. #                            RndPtInRect(theRect)
  2469. #=======================================================================
  2470. # Author:            NJV
  2471. # Description:        Returns a random point inside of theRect.  If theRect
  2472. #                    is not passed, it will return a random point of the 
  2473. #                    content region of the first window with a grow and a
  2474. #                    zoom box, or if there are none, then the first window
  2475. #                    it finds, and if no windows are present, returns 0.
  2476. # Parameters:        theRect - bounding rectangle
  2477. # Returns:            0 - Default behavior requested with no windows up
  2478. #                    Point -    list of 2 coordinates - {x,y}
  2479. # Examples:            thePoint := RndPtInRect();    # get random point in window content
  2480. #                    thePoint := RndPtInRect({20,20,80,80});    # random point in {20,20,80,80}
  2481. # Assumptions:        None
  2482. #=======================================================================
  2483. Calls:    _match(), 
  2484. Is called by:    RndPtInWindow(), 
  2485.  
  2486.  
  2487. Task:    RectInRect(rect1, rect2)
  2488. Library:    Geometry.lib
  2489. Header:
  2490. #########################################################################
  2491. #                        RectInRect(rect1,rect2)
  2492. #========================================================================
  2493. # Author:            SMQ
  2494. # Description:        This routine determines whether or not first rectangle 
  2495. #                    lies completely within the second.  This is done by 
  2496. #                    comparing the coordinates of both rectangles. 
  2497. # Parameters:        rect1 - holds the coordinates of the first rectangle.
  2498. #                    rect2 - holds the coordinates of the second rectangle.
  2499. # Returns:            value - first rectangle lies in the second.
  2500. #                    false - first rectangle does NOT lie in the second.
  2501. # Examples:            RectInRect(rect1,rect2).
  2502. # Assumptions:        None
  2503. #========================================================================
  2504. Calls:
  2505. Is called by:    CoverCompletely()
  2506.  
  2507.  
  2508. Task:    GetXYRandom(inset := { 0,0,0,0}, Rect := {}, numPts := 1)
  2509. Library:    Geometry.lib
  2510. Header:
  2511. ########################################################################
  2512. #                        GetXYRandom(inset, Rect, numPts)
  2513. #=======================================================================
  2514. # Author:             SL
  2515. # Description:        Returns a random X and Y coordinate in the specified
  2516. #                    Rect.
  2517. # Parameters:        inset - ltrb inset from scrn or window
  2518. #                    specifier > 0 window to find coords in
  2519. #                              = O coords in window with s:doc g:true and c:true
  2520. #                              < 0 coords in specified screen.  Screen numbersta
  2521. #                                is negative of specifier.
  2522. # Returns:            xyRandom - List of random X and Y.  eg. { x, y }
  2523. #=======================================================================
  2524. Calls:    ExceptionDispatcher(), 
  2525. Is called by:    RandomTextSelection(), DragWindow(), SizeWindow(), 
  2526.                 GetRandomPointsRelativeToWindow(), MoveMouse()
  2527.  
  2528.  
  2529. Task:    CenterPointOfRect(pTheRect := {})
  2530. Library:    Geometry.lib
  2531. Header:
  2532. ########################################################################
  2533. #                        CenterPointOfRect(pTheRect)
  2534. #=======================================================================
  2535. # Author:             KTA
  2536. # Description:        Returns the center point of the input parameter <pTheRect>
  2537. # Parameters:        pTheRect - the rect that you want the center point of.
  2538. # Returns:            returnVal  - List { x, y }
  2539. #=======================================================================
  2540. Calls:
  2541. Is called by:    CenterofRectClick()
  2542.  
  2543.  
  2544.  
  2545.  
  2546.  
  2547.  
  2548.  
  2549.  
  2550.  
  2551. ##############################################################
  2552. ##############################################################
  2553. ##############################################################
  2554. Library: Gestalt.Lib
  2555. Calls: "ExceptionHandling.lib";
  2556.  
  2557.  
  2558. Task:    Check32Bit()
  2559. Library:    Gestalt.Lib
  2560. Header:
  2561. ##################################################################################
  2562. #                        Check32Bit()
  2563. #=======================================================================
  2564. # Author:        GS
  2565. # Description:    This routine will check the state of 32 bit addressing,
  2566. #                and returns the value.
  2567. # Parameters:    None
  2568. # Returns:        Values
  2569. #                On        :=  1
  2570. #                Off        :=  0
  2571. #                not Avail :=  -1
  2572. #                GestaltError
  2573. #                in the first item a value described above.  The second item is a text 
  2574. #                string description of the value.
  2575. #=======================================================================
  2576. Calls:    GetGestaltValue()
  2577. Is called by:    PreFlight(), MachineState()
  2578.  
  2579.  
  2580. Task:    CheckVM()
  2581. Library:    Gestalt.Lib
  2582. Header:
  2583. ##################################################################################
  2584. #                        CheckVM()
  2585. #=======================================================================
  2586. # Author:        GS
  2587. # Description:    Checks to see if VM is turned on.
  2588. #
  2589. # Parameters:    None
  2590. # Returns:        On   :=  1
  2591. #                Off  :=     0
  2592. #                not Avail :=  -1
  2593. #                GestaltError
  2594. # if VM is on gestalt('vm  ') returns a 1
  2595. # any other case (not available, not turned on is a 0)
  2596. #=======================================================================
  2597. Calls:    GetGestaltValue()
  2598. Is called by:    MachineState()
  2599.  
  2600.  
  2601. Task:    LowWordOfAnswer(Answer)
  2602. Library:    Gestalt.Lib
  2603. Header:
  2604. ##################################################################################
  2605. #                        LowWordOfAnswer()
  2606. #=======================================================================
  2607. # Author:        GS
  2608. # Description:    Returns second item of a list.
  2609. #
  2610. # Parameters:    None
  2611. # Returns:        second item of a list
  2612. #=======================================================================
  2613. Calls:
  2614. Is called by:    GetGestaltValue(), 
  2615.  
  2616.  
  2617. Task:    GetGestaltValue(pAnswer)
  2618. Library:    Gestalt.Lib
  2619. Header:
  2620. ##################################################################################
  2621. #                        GetGestaltValue()
  2622. #=======================================================================
  2623. # Author:        GS
  2624. # Description:    Checks a 2 element list, If 2nd element type list, 
  2625. #                call LowWordOfAnswer, otherwise return the element.
  2626. #
  2627. # Parameters:    pAnswer - 2 element list returned from VU's built-in
  2628. #                            gestalt task
  2629. # Returns:        integer
  2630. #=======================================================================
  2631. Calls:
  2632. Is called by:    Check32Bit(), CheckVM(), GestaltFPUType(), GestaltMachineType(), 
  2633.                 GestaltMMUType(), GestaltSystemArchitecture()
  2634.  
  2635.  
  2636. Task:    GestaltLongError(gestaltAnswer := {0,{0,0}})
  2637. Library:    Gestalt.Lib
  2638. Header:
  2639. ##################################################################################
  2640. #                        GestaltLongError()
  2641. #=======================================================================
  2642. # Author:        GS
  2643. # Description:    Will return a longer error response in the form of a string.
  2644. #
  2645. # Parameters:    None
  2646. # Returns:        String with error text
  2647. #=======================================================================
  2648. Calls:
  2649. Is called by:    GestaltFPUType(), GestaltMachineType(), GestaltProcessorType(), 
  2650.                 GestaltMMUType(), GestaltLogicalRAMSize(), GestaltPhysicalRAMSize()
  2651.  
  2652.  
  2653. Task:    GestaltFPUType()
  2654. Library:    Gestalt.Lib
  2655. Header:
  2656. ##################################################################################
  2657. #                        GestaltFPUType()
  2658. #=======================================================================
  2659. # Author:        Derived from Virtual User 2.0 Example libraries
  2660. # Description:    Returns FPU type.
  2661. #
  2662. # Parameters:    None
  2663. # Returns:        NoFPU
  2664. #                68881
  2665. #                68882
  2666. #                68040
  2667. #                unknFPU
  2668. #=======================================================================
  2669. Calls:
  2670. Is called by:    PreFlight(), MachineState()
  2671.  
  2672.  
  2673. Task:    GestaltMachineType(ReturnMachineName := 0)
  2674. Library:    Gestalt.Lib
  2675. Header:
  2676. ##################################################################################
  2677. #                        GestaltMachineType()
  2678. #=======================================================================
  2679. # Author:        Derived from Virtual User 2.0 Example libraries
  2680. # Description:    Checks machine being tested and returns string with Machine Type.
  2681. #
  2682. # Parameters:    0 - return machine number
  2683. #                1 - return machine name
  2684. # Returns:        String with Machine Name or integer with machine number
  2685. #                (See list below)
  2686. #=======================================================================
  2687. Calls:    GetGestaltValue(), GestaltLongError()
  2688. Is called by:    MachineState()
  2689.  
  2690.  
  2691. Task:    GestaltProcessorType()
  2692. Library:    Gestalt.Lib
  2693. Header:
  2694. ##################################################################################
  2695. #                        GestaltProcessorType()
  2696. #=======================================================================
  2697. # Author:        Derived from Virtual User 2.0 Example libraries
  2698. # Description:    Returns the processor running on the test machine
  2699. #
  2700. # Parameters:    None
  2701. # Returns:        68000
  2702. #                68010
  2703. #                68020
  2704. #                68030
  2705. #                68040
  2706. #=======================================================================
  2707. Calls:    _Gestalt(), GestaltLongError()
  2708. Is called by:    PreFlight(), MachineState(), CheckCache()
  2709.  
  2710.  
  2711. Task:    GestaltMMUType()
  2712. Library:    Gestalt.Lib
  2713. Header:
  2714. ##################################################################################
  2715. #                        GestaltMMUType()
  2716. #=======================================================================
  2717. # Author:        Derived from Virtual User 2.0 Example libraries
  2718. # Description:    Will return the memory management unit type found operating on the target.
  2719. #
  2720. #
  2721. # Parameters:    None
  2722. # Returns:        NoMMU
  2723. #                AMU
  2724. #                68851
  2725. #                68030MMU
  2726. #                68040MMU
  2727. #                unknMMUType
  2728. #=======================================================================
  2729. Calls:    _Gestalt, GetGestaltValue(), GestaltLongError()
  2730. Is called by:    MachineState()
  2731.  
  2732.  
  2733. Task:    GestaltLogicalRAMSize()
  2734. Library:    Gestalt.Lib
  2735. Header:
  2736. ##################################################################################
  2737. #                        GestaltLogicalRAMSize()
  2738. #=======================================================================
  2739. # Author:        Derived from Virtual User 2.0 Example libraries
  2740. # Description:    Will return the amount of logical RAM located in a machine.
  2741. #                (VM+RM)  
  2742. #
  2743. #
  2744. # Parameters:    None
  2745. # Returns:        an integer in megabytes.
  2746. #=======================================================================
  2747. Calls:    _Gestalt(), GestaltLongError()
  2748. Is called by:    
  2749.  
  2750.  
  2751. Task:    GestaltPhysicalRAMSize()
  2752. Library:    Gestalt.Lib
  2753. Header:
  2754. ##################################################################################
  2755. #                        GestaltPhysicalRAMSize()
  2756. #=======================================================================
  2757. # Author:        Derived from Virtual User 2.0 Example libraries
  2758. # Description:    Will return the amount of physical RAM located in a machine.
  2759. #
  2760. #
  2761. # Parameters:    None
  2762. # Returns:        an integer in megabytes.
  2763. #=======================================================================
  2764. Calls:    _Gestalt(), GestaltLongError()
  2765. Is called by:    
  2766.  
  2767.  
  2768. Task:    GestaltSystemArchitecture()
  2769. Library:    Gestalt.Lib
  2770. Header:
  2771. #########################################################################
  2772. #                 GestaltSystemArchitecture()
  2773. #=======================================================================
  2774. # Author:          KTA
  2775. # Description:    Makes a Gestalt call with selector of 'sysa' to determine if the
  2776. #                target system is 68K or PowerPC
  2777. # Parameters:    none
  2778. # Returns:        0 - Selector not installed (older 68k)
  2779. #                1 - Selector installed - target is 68k based not PowerPC
  2780. #                2 - Selector installed - target is PowerPC based not 68k
  2781. #=======================================================================
  2782. Calls:    _Gestalt, GetGestaltValue()
  2783. Is called by:    IsPowerPC()
  2784.  
  2785.  
  2786.  
  2787.  
  2788.  
  2789.  
  2790.  
  2791.  
  2792.  
  2793. ##############################################################
  2794. ##############################################################
  2795. ##############################################################
  2796. Library: Globals.Lib
  2797. Calls: "Custom.Lib", "ExceptionHandling.Lib", "Output.Lib", "CrashHandling.Lib"
  2798.  
  2799.  
  2800.  
  2801. Task:    InitGlobals(pTheScriptParam := -1, pGlobalsDefList := undefined) 
  2802. Library:    Globals.Lib
  2803. Header:
  2804. #########################################################################
  2805. #                            InitGlobals()
  2806. #========================================================================
  2807. # Author:        KTA
  2808. # Description:    Initializes most global variables used by the SPEC S&L.  
  2809. #                This Task should be called prior to making any calls to 
  2810. #                any tasks contained within the SPEC S&L Libraries
  2811. #                Please refer to 'The Hitchhikers Guide' for more information 
  2812. #                concerning any individual global.
  2813. # Parameters:    pTheScriptParam - (list or integer)
  2814. #                                - list - contains both parameters to SetTestLevel() 
  2815. #                                - integer - only first parameter to SetTestLevel()
  2816. #                                    (see SetTestLevel() header for more details)
  2817. #
  2818. #                pGlobalsDefList - list of lists with each inner list containing a 
  2819. #                                label (string - name of the global) and a value for the global.            
  2820. #                                This enables the user to define globals through VU's 
  2821. #                                interface for individual scripts without having to
  2822. #                                modify any SPEC S&L files (i.e. Custom.Lib)
  2823. #                                
  2824. #                                By providing a definition for a global, you will only 
  2825. #                                effect that specific global, all other globals are 
  2826. #                                given default values. 
  2827. #                                
  2828. #                                The globals which can be defined are as follows:
  2829. #                                1) gCommandExceptions        2) gExceptionHandlerList
  2830. #                                3) gCrashHandling            4) gAppVerify
  2831. #                                5) gTestCaseLoggingMethod    6) gDebugFlag
  2832. #                                7) gTextStr                    8) kScrapTEXT
  2833. #                                9) kScrapPICT                10) gScrapTitle
  2834. #                                11) gAliasDirectory            12) gTCTracking
  2835. #                                13) gPreFlight                14) gFontList
  2836. #                                15) gFontSizeList            16) gFontStyleList
  2837. #                                17) gSFPUTLocation            18) gPrintTest
  2838. #                                19) gDoWindowList            20) gBackgroundQuit
  2839. #                                21) gForceQuit                22) gSeedValue
  2840. #                                23) gMacroCommands            24) gAdditionalTargetInfo
  2841. #                                25) gSpecialErrorHandlers    26) gPrintSuiteInfo
  2842. #                                27) gLaunchReqs
  2843. # Returns:        Nothing
  2844. # Examples:        InitGlobals({2, {{'DrawLevel', 1}}}, {{'gSeedValue', 1542}, {'gCrashHandling', false}});
  2845. # Assumptions:     
  2846. #========================================================================
  2847. Calls:    SetTestLevel(), InitCustom(), logstr(), gInitGlobalsThreadingHook, InitRandomSeed()
  2848. Is called by:    SuiteStart()
  2849.  
  2850.  
  2851. Task:    InitRandomSeed()
  2852. Library:    Globals.Lib
  2853. Header:
  2854. #########################################################################
  2855. #                        InitRandomSeed()
  2856. #========================================================================
  2857. # Author:        ML
  2858. # Description:    Initializes the random seed. 
  2859. # Parameters:    None
  2860. # Returns:        Nada
  2861. # Examples:        InitRandomSeed();
  2862. # Assumptions:    
  2863. #========================================================================
  2864. Calls:    LogStr()
  2865. Is called by:    
  2866.  
  2867.  
  2868. Task:    SetTestLevel(pTestLevel := 1, pCustomSetting := {})
  2869. Library:    Globals.Lib
  2870. Header:
  2871. #########################################################################
  2872. #            SetTestLevel(pTestLevel := 1, pCustomSetting := {})
  2873. #========================================================================
  2874. # Author:        KTA 
  2875. # Description:    Will set globals that will determine the level of testing 
  2876. #                that will occur in the DoTests.
  2877. # Parameters:    pTestLevel := Generic level of testing desired.
  2878. #                            1 - least amount of testing
  2879. #                            2 - medium amount of testing
  2880. #                            3 - Most amount of testing
  2881. #                pCustomSetting - Any Custom settings, this will override the 
  2882. #                                generic settings for any specified global setting.
  2883. # Returns:        
  2884. # Examples:        SetTestLevel( 1, {{'DrawLevel', {1,2}}} ); 
  2885. # Assumptions:    Note : the labels used to set individual methods are as follows:
  2886. #                        1) DrawLevel
  2887. #                        2) FontLevel
  2888. #                        3) WindowLevel
  2889. #                        4) AppTestLevel
  2890. #========================================================================
  2891. Calls:    LogStr()
  2892. Is called by:    InitGlobals()
  2893.  
  2894.  
  2895.  
  2896.  
  2897.  
  2898.  
  2899.  
  2900.  
  2901.  
  2902. ##############################################################
  2903. ##############################################################
  2904. ##############################################################
  2905. Library: IvyOperations.Lib
  2906. Calls: "Ivy Tool Declaration.vulib", "Ivy.vuLib", "Output.Lib", 
  2907.         "String.Lib", "ExceptionHandling.Lib";
  2908.  
  2909.  
  2910. Task:    _Ivy(pServiceOrTask, pParamList := {}, pOnTarget := true, pIsRetry := 0)
  2911. Library:    IvyOperations.Lib
  2912. Header:
  2913. #########################################################################
  2914. #        _Ivy(pOnTheTarget := true)
  2915. #========================================================================
  2916. # Author:        KTA 
  2917. # Description:    Does the exception handling for the Ivy.  All high level tasks
  2918. #                should call this routine for file tool services.  Handles initialization
  2919. #                of tool automatically.
  2920. # Parameters:    pServiceOrTask - Name of the Service
  2921. #                pParamList - List of parameters
  2922. #                pOnTarget - Flag to indicate whether the service should be performed 
  2923. #                            the host or the target.  1 = target/0 = host.
  2924. # Returns:        Whatever the file tool returns
  2925. # Examples:        _Ivy('LocateImage', {'fileName'},1);
  2926. # Assumptions:    None 
  2927. #========================================================================
  2928. Calls:    Ivy(), ExceptionDispatcher(), _Ivy()
  2929. Is called by:    _Ivy(), InitIvy(), QuitIvy(), RemoveIVTimingMethod(), StartTimerIV(), 
  2930.                 StopTimerIV(), LocateTheString(), TimeCutPaste(), TimeSaveAs(), 
  2931.                 TimeOpenFile(), TimeScrolling()
  2932.  
  2933.  
  2934. Task:    InitIvy(pOnTheTarget := true)
  2935. Library:    IvyOperations.Lib
  2936. Header:
  2937. #########################################################################
  2938. #        InitIvy(pOnTheTarget := true)
  2939. #========================================================================
  2940. # Author:        KTA 
  2941. # Description:    Initializes the Ivy 
  2942. # Parameters:    pOnTheTarget - True if you want to launch the Ivy on  
  2943. #                                the target machine. False if on the Host.
  2944. # Returns:        0 - Couldn't initialize
  2945. #                1 - Init On Target
  2946. #                2 - Init On Host
  2947. # Examples:        InitIvy();
  2948. # Assumptions:    None 
  2949. #========================================================================
  2950. Calls:    _Ivy(), 
  2951. Is called by:    TimeCutPaste(), TimeSaveAs(), TimeOpenFile(), TimeScrolling()
  2952.  
  2953.  
  2954. Task:    QuitIvy(pOnTheTarget := true)
  2955. Library:    IvyOperations.Lib
  2956. Header:
  2957. #########################################################################
  2958. #        QuitIvy()
  2959. #========================================================================
  2960. # Author:        KTA 
  2961. # Description:    Quits  Ivy 
  2962. # Parameters:    none
  2963. # Returns:        0 - Couldn't Quit
  2964. #                1 - Quit Successfully
  2965. # Examples:        QuitIvy();
  2966. # Assumptions:    None 
  2967. #========================================================================
  2968. Calls:    _Ivy()
  2969. Is called by:    TimeCutPaste(), TimeSaveAs(), TimeOpenFile(), TimeScrolling()
  2970.  
  2971.  
  2972.  
  2973.  
  2974.  
  2975.  
  2976.  
  2977.  
  2978.  
  2979. ##############################################################
  2980. ##############################################################
  2981. ##############################################################
  2982. Library: LaunchQuit.Lib
  2983. Calls: "TCS.Lib" , "Output.Lib", "String.Lib", "Gestalt.Lib", "StandardFile.Lib",
  2984. "OnTarget.Lib", "TargetCheck.Lib","UserInterface.Lib", "OnTargetOperations.Lib",
  2985. "ExceptionHandling.Lib"
  2986.  
  2987.  
  2988.  
  2989. Task:    Twitcher(appName := "") 
  2990. Library:    LaunchQuit.Lib
  2991. Header:
  2992. #########################################################################
  2993. #                             Twitcher(appName)    
  2994. #========================================================================
  2995. # Author:         DM
  2996. # Description:    This Task is intended to select apps from the Process List
  2997. #                menu in System 7.0.  Use LaunchTwitch to handle launching 
  2998. #                or twitching applications.
  2999. #                This routine selects apps from the Process List.
  3000. # Parameters:        appName - app to twitch to.
  3001. # Returns:            0 if twitching to appName fails
  3002. #                    TheCurrentApp - if twitching was successful
  3003. # Examples:            Twitcher("MacWrite 5.0");
  3004. # Assumptions:        None
  3005. #========================================================================
  3006. Calls:    ExceptionDispatcher(), _match(), isSubString(), _matchBoolean()
  3007.         TCSStart(), _select(), LogStr(), MatchApplication(), TCSEnd()
  3008. Is called by:    Quit(), TwitchQuit(), LaunchTwitch()
  3009.  
  3010.  
  3011. Task:    MiniLaunch(appTitle, LaunchApp := 1,SetDir := 1)
  3012. Library:    LaunchQuit.Lib
  3013. Header:
  3014. #########################################################################
  3015. #                MiniLaunch(appTitle, LaunchApp, SetDir)
  3016. #========================================================================
  3017. # Author:        NJV - DMM
  3018. # Description:    This routine will launch an application on the target
  3019. #                machine(s).  The miniLauncher tool should be the running
  3020. #                application on the target machine(s).  This routine will
  3021. #                type the input parameter appTitle to the target machine
  3022. #                and then type the return key (which is how an application
  3023. #                is launched using miniLauncher.)  The application to be
  3024. #                launched must reside in a folder beneath the miniLauncher
  3025. #                tool in the directory hierarchy. For more information on
  3026. #                the miniLauncher tool, see the read-me that accompanies
  3027. #                the tool.  
  3028. #                MiniLauncher can also open or print documents.  See the
  3029. #                LaunchApp parameter description below for more details.
  3030. #
  3031. # Parameters:    appTitle -    title of the application or document to be launched.
  3032. #                            The title does not have to be complete.  The MiniLauncher
  3033. #                            tool will launch the first application it finds
  3034. #                            starting with the string appTitle.  If LaunchApp
  3035. #                            parameter is not 1, then appTitle will hold the
  3036. #                            document name to be opened or printed.
  3037. #                LaunchApp - 1 to launch application
  3038. #                            0 to launch application via a document
  3039. #                            -1 to print a document (launch app and print)
  3040. #                SetDir    -    1 to set the default directory to that of the
  3041. #                                application
  3042. #                            0 to bypass setting of default directory (will
  3043. #                                end up being MiniLauncher's directory).
  3044. #
  3045. # Returns:        1 - Launched OK
  3046. #                0 - Couldn't launch application (usually due to lack of 
  3047. #                        enough memory on the target machine).
  3048. #
  3049. # Examples:        MiniLaunch('Word');
  3050. #========================================================================
  3051. Calls:    _matchBoolean(), _match(), _select(), LogStr(), SelectRadioButton(),
  3052.         SelectButton(), TypeStr(), SpecialKey(), DialogCheck(), MatchApplication()
  3053. Is called by:    LaunchTwitch()
  3054.  
  3055.  
  3056. Task:    Quit(pOverWrite :=1, pDocName:="", pHowQuit :=1, pCloseScrapbook:=1, 
  3057.             pCloseFinderWindows:=1,pRecursionFlag := 1)
  3058. Library:    LaunchQuit.Lib
  3059. Header:
  3060. #########################################################################
  3061. #                         Quit(pOverWrite, pDocName)
  3062. #=======================================================================
  3063. # Author:          KTA
  3064. # Description:    Will turn off the Application Verification scheme, Select
  3065. #                the Quit menu item, check whether or not to save changes,
  3066. #                then reset the App verification scheme to its previous state.
  3067. # Parameters:    pOverWrite    1    - Save changes.
  3068. #                            0    - Don't save changes.
  3069. #                pDocName        -    The string that will be used to save the document
  3070. #                pHowQuit    1    - Select "Quit" from File Menu
  3071. #                            2    - Type Cmd-Q to quit
  3072. #                        {list}    - ord or string path to Quit menuitem, i.e.
  3073. #                                    {"Quit", "File"} or {17, 2}
  3074. #            pCloseScrapbook    1    - close the scrapbook after quitting
  3075. #                            0    - don't close the scrapbook after quitting
  3076. #        pCloseFinderWindows    1    - close finder windows after quitting
  3077. #                            0    - don't close finder windows after quitting    
  3078. #        pRecursionFlag        0     - Don't call Quit recurively if unable to quit.
  3079. #                            1     - Call Quit recurively if unable to quit.
  3080. # Returns:                    -2     - All quitting bypassed (gForceQuit enabled)
  3081. #                            -1    - Closed all windows of current app (gBackgroundQuit enabled)
  3082. #                             0    - Unable to quit current app
  3083. #                             1    - successfully quit current app
  3084. #=======================================================================
  3085. Calls:    MatchApplication(), logstr(), CloseAllWindows(), TCSStart(), keyEq(), 
  3086.         SelectMenuItem(), checkYesNo(), _matchBoolean(), SaveAs(), Twitcher(), 
  3087.         DialogHandler(), Quit(), TCSEnd(), closeWindow(), 
  3088. Is called by:    DoCloseApp(), Quit(), TwitchQuit()
  3089.  
  3090.  
  3091. Task:    QuitBackgroundApps() 
  3092. Library:    LaunchQuit.Lib
  3093. Header:
  3094. #########################################################################
  3095. #            QuitBackgroundApps()
  3096. #========================================================================
  3097. # Author:            ML
  3098. # Description:        Checks for Background Quit Dialog, then
  3099. #                    chooses "quit apps" if BackgroundQuit is ON or 
  3100. #                    "Cancel" if it's OFF.
  3101. # Parameters:        None
  3102. # Returns:            -2    Couldn't dismiss BG Quit dialog
  3103. #                    -1    BG Quit dialog present, "Cancel" button selected
  3104. #                     0    BG Quit dialog not present
  3105. #                     1    BG Quit dialog present, "Quit apps" button selected
  3106. # Assumptions:        7.x
  3107. #========================================================================
  3108. Calls:    _matchBoolean(), ExceptionDispatcher(), logstr(), TCSStart(), SpecialKey(), 
  3109.         selectbutton(), TCSEnd()
  3110. Is called by:    LaunchAssist()
  3111.  
  3112.  
  3113. Task:    TwitchQuit()
  3114. Library:    LaunchQuit.Lib
  3115. Header:
  3116. #########################################################################
  3117. #            TwitchQuit()
  3118. #========================================================================
  3119. # Author:            ML
  3120. # Description:        Selects the fifth item (first app or da) in the process list, or sixth        
  3121. #                    if the fifth is "Finder", and quits it.
  3122. # Parameters:        None
  3123. # Returns:            0 - Could not quit an app or da
  3124. #                    1 - quit app or da ok
  3125. # Assumptions:        7.0x -  There is a process list
  3126. #========================================================================
  3127. Calls:    Twitcher(), logstr(), ExceptionDispatcher(), Quit()
  3128. Is called by:    LaunchAssist()
  3129.  
  3130.  
  3131. Task:    LaunchAssist(pAppName := '')
  3132. Library:    LaunchQuit.Lib
  3133. Header:
  3134. #########################################################################
  3135. #                        LaunchAssist(pAppName)
  3136. #========================================================================
  3137. # Author:            ML
  3138. # Description:        Assist launch process by background quitting, checking
  3139. #                    for "not enough memory" dialogs, and twitch and quitting.
  3140. # Parameters:        pAppName - name of the application to be launched.
  3141. # Returns:            -3 - unsuccessful- not enough memory
  3142. #                    -2 - unsuccessful - background quit cancelled
  3143. #                    -1 - unsuccessful - twitchquit failed
  3144. #                    0 -    unsuccessful - alias not found
  3145. #                    1 - successful launch
  3146. #                    2 - successful twitchquit
  3147. # Assumptions:        7.0x -  There is a process list
  3148. #========================================================================
  3149. Calls:    _matchBoolean(), DialogCheck(), QuitBackgroundApps(), TwitchQuit()
  3150. Is called by:    LaunchByAppleMenu(), LaunchByTypeSelect()
  3151.  
  3152.  
  3153. Task:    LaunchByAppleMenu(ItemName)
  3154. Library:    LaunchQuit.Lib
  3155. Header:
  3156. #########################################################################
  3157. #            LaunchByAppleMenu()
  3158. #========================================================================
  3159. # Author:            ML
  3160. # Description:        Launch via the Apple Menu
  3161. # Parameters:        ItemName - name of app or DA to launch
  3162. # Returns:            -3 - unsuccessful- not enough memory
  3163. #                    -2 - unsuccessful - background quit cancelled
  3164. #                    -1 - unsuccessful - twitchquit failed
  3165. #                    0 -    unsuccessful - alias not found
  3166. #                    1 - successful launch
  3167. # Assumptions:        7.0x -  There is a process list
  3168. #                    ItemName is in apple menu
  3169. #========================================================================
  3170. Calls:    TCSStart(), Selectmenuitem(), LaunchAssist(), TCSEnd(), 
  3171. Is called by:    LaunchByTypeSelect(), LaunchTwitch()
  3172.  
  3173.  
  3174. Task:    LaunchByTypeSelect(AppName, AliasDir := "")
  3175. Library:    LaunchQuit.Lib
  3176. Header:
  3177. #########################################################################
  3178. #            LaunchByTypeSelect()
  3179. #========================================================================
  3180. # Author:            ML
  3181. # Description:        Launch via type select
  3182. # Parameters:        AppName - name of app or DA to launch
  3183. #                    AliasDir - name of alias directory
  3184. # Returns:            -3 - unsuccessful- not enough memory
  3185. #                    -2 - unsuccessful - background quit cancelled
  3186. #                    -1 - unsuccessful - twitchquit failed
  3187. #                    0 -    unsuccessful - other
  3188. #                    1 - successful launch
  3189. # Assumptions:        7.0x -  There is a process list
  3190. #========================================================================
  3191. Calls:    _matchBoolean(), LaunchByAppleMenu(), TCSStart(), typeStr(), 
  3192.         VerifyAppPriorToLaunch(), TCSEnd(), KeyEq(), LaunchAssist(), 
  3193.         isSubString(), logstr()
  3194. Is called by:    LaunchTwitch()
  3195.  
  3196.  
  3197. Task:    LaunchFillMemApp()
  3198. Library:    LaunchQuit.Lib
  3199. Header:
  3200. #########################################################################
  3201. #            LaunchFillMemApp()
  3202. #========================================================================
  3203. # Author:            ML
  3204. # Description:        Launch global gfillMemApp
  3205. # Parameters:        None
  3206. # Returns:            none
  3207. # Assumptions:        7.0x -  There is a process list
  3208. #                    Alias or original of gFillMemApp is in apple menu
  3209. #                    or in alias directory.  Memory allocation of gFillMemApp
  3210. #                    has been set high enough to fill up remaining memory.
  3211. #========================================================================
  3212. Calls:    LaunchTwitch()
  3213. Is called by:    LaunchTwitch()
  3214.  
  3215.  
  3216. Task:    LaunchTwitch(AppName, AliasDir:= global gAliasDirectory, 
  3217.         LaunchApp := 1, SuiteBailOut:=1) 
  3218. Library:    LaunchQuit.Lib
  3219. Header:
  3220. #########################################################################
  3221. #            LaunchTwitch(AppName, AliasDir, LaunchApp, SuiteBailOut)
  3222. #========================================================================
  3223. # Author:            KTA
  3224. # Description:        This routine determines whether the Operating system is 
  3225. #                    6.0x or 7.0x and launches the application accordingly.  
  3226. #                    6.0x -  Will check the Apple menu to see if the App is 
  3227. #                    currently running and select it if it is. If it is not running
  3228. #                    it will select Mini from the Apple menu and call MiniLaunch(AppName);
  3229. #                    7.0x -  Will check the ProcessList to see if the App is 
  3230. #                    currently running and select it if it is.  if it is not it will
  3231. #                    Select the Apple from the Apple Menu, or the <AliasDir> and then type
  3232. #                    the <AppName> and select the Open menuItem.
  3233. # Parameters:        AppName - Application to be launched/Twitched
  3234. #                    AliasDir -  Folder in the Apple menu that contains <AppName>.
  3235. #                    LaunchApp - 0    Select from Process list - Do not launch the App.
  3236. #                                1    Select from Process list or launch the App if 
  3237. #                                    necessary.
  3238. #                    SuiteBailOut -    1    Call ExceptionDispatcher(-70) to bail out of suite if
  3239. #                                        LaunchTwitch fails
  3240. #                                    0    Don't call ExceptionDispatcher(-70) to bail out of suite if
  3241. #                                        LaunchTwitch fails
  3242. # Returns:            0 - App did not launch
  3243. #                    AppName - Name of app that launched
  3244. # Examples:            LaunchTwitch('MacWrite', "#CoreAliases");
  3245. #                    LaunchTwitch('MacWrite Doc',"#CoreAliases",0);
  3246. # Assumptions:        7.0x -  That the Application (or Alias) is resident in the 
  3247. #                    Apple Menu or the <AliasDir> which contains <AppName> is.
  3248. #========================================================================
  3249. Calls:    gScriptBeginCriticalHook, TCSStart(), gLaunchTwitchHook1, PreFlight(), 
  3250.         TCSEnd(), _matchBoolean(), gLaunchTwitchHook2, gPatchLaunchTwitch, 
  3251.         Twitcher(), _match(), LaunchByAppleMenu(), gLaunchTwitchHook3, 
  3252.         LaunchByTypeSelect(), Minilaunch(), MatchApplication(), DialogCheck(), 
  3253.         LaunchFillMemApp(), logstr(), gLaunchTwitchHook4, gScriptEndCriticalHook
  3254. Is called by:    Scrapbook(), FinderNavigate(), ShimmerMateCopy(), LaunchFillMemApp(), 
  3255.                 
  3256.  
  3257.  
  3258. Task:    PreFlight(myList)
  3259. Library:    LaunchQuit.Lib
  3260. Header:
  3261. #########################################################################
  3262. #             PreFlight(List) - Called by LaunchTwitch, Set global 
  3263. #                               gLaunchReqs to parameter list.
  3264. #========================================================================
  3265. # Author:        GS
  3266. #
  3267. # Description:    This routine will test whether or not your script will run on the 
  3268. #                targets hardware and software configuration.  PreFlight will test 
  3269. #                the machine for each selectors specified and return a fail if any 
  3270. #                of the selectors fail.
  3271. #
  3272. # Parameters:    'fpu'        Returns a fail on machines that do not have an fpu.
  3273. #                'color'     Returns a fail on machines that are not set to color.
  3274. #                '8bd'        Returns a fail on machines that are not set to at least 8bit depth.
  3275. #                'no68000'   Returns a fail on 68000 machines (support 'no68k' for compatibility reasons).
  3276. #                'noCache'   Returns a fail on '040's that have caching turned on.
  3277. #                'no32'        Returns a fail on cpu's with 32 bit addressing turned on
  3278. #                '68kArch'    Returns a fail on cpu's that are not 68k based
  3279. #                'PowerPCArch'    Returns a fail on cpu's that are not PowerPC based
  3280. #
  3281. # Returns:        fail: {0, 'Error Message'}
  3282. #                pass:  {1, ''}
  3283. #
  3284. # Examples:        gLaunchReqs = {'fpu', 'color', '8bd', 'no68K', 'noCache'};
  3285. #
  3286. #========================================================================
  3287. Calls:    GestaltFPUType(), IsPowerPC(), ExceptionDispatcher(), GestaltProcessorType(),
  3288.         OnTargetInit(), _OnTarget(), Check32Bit()
  3289. Is called by:    LaunchTwitch()
  3290.  
  3291.  
  3292. Task:    VerifyAppPriorToLaunch(pTheExpectedApp := '')
  3293. Library:    LaunchQuit.Lib
  3294. Header:
  3295. #########################################################################
  3296. #             VerifyAppPriorToLaunch(pTheExpectedApp)
  3297. #=======================================================================
  3298. # Author:              KTA
  3299. # Description:        Verifies that the title of the GetInfoWindow contains
  3300. #                    the string <pTheExpectedApp>.
  3301. # Parameters:        pTheExpectedApp    :=    Name of the App to verify
  3302. # Returns:            0        :=    String was not contained in GetInfoWindow
  3303. #                    1        :=    String was contained in GetInfoWindow
  3304. #=======================================================================
  3305. Calls:    KeyEq(), _matchBoolean(), ExceptionDispatcher(), IsSubString()
  3306. Is called by:    LaunchByTypeSelect()
  3307.  
  3308.  
  3309.  
  3310.  
  3311.  
  3312.  
  3313.  
  3314.  
  3315.  
  3316.  
  3317. ##############################################################
  3318. ##############################################################
  3319. ##############################################################
  3320. Library: MemoryMonitorOperations.lib
  3321. Calls: "MemoryMonitor.vulib","ExceptionHandling.Lib"
  3322.  
  3323.  
  3324. Task:    _MemoryMonitor(pServiceOrTask, pParamList := {}, pOnTarget := true, pIsRetry := 0)
  3325. Library:    MemoryMonitorOperations.lib
  3326. Header:
  3327. #########################################################################
  3328. #            _MemoryMonitor(pServiceOrTask, pParamList, pOnTarget, pIsRetry)
  3329. #========================================================================
  3330. # Author:        KTA 
  3331. # Description:    Does the exception handling for the MemoryMonitor.  All high level tasks
  3332. #                should call this routine for MemoryMonitor tool services.  
  3333. #                Handles initialization of tool automatically.
  3334. # Parameters:    pServiceOrTask - Name of the Service
  3335. #                pParamList - List of parameters
  3336. #                pOnTarget - Flag to indicate whether the service should be performed 
  3337. #                            the host or the target.  1 = target/0 = host.
  3338. # Returns:        What ever the MemoryMonitor returns - list of three elements
  3339. #                            { errCode, Data, [error message]}
  3340. # Examples:        _MemoryMonitor('GetProcess', {'SystemZone'},1);
  3341. # Assumptions:    None 
  3342. #========================================================================
  3343. Calls:    MemoryMonitor(), ExceptionDispatcher(), _MemoryMonitor(), 
  3344. Is called by:    InstallEveryTimeMacro(), _MemoryMonitor(), MemoryMonitorInit(), 
  3345.                 MemoryMonitorQuit(), RecordGetAboutThisMacintosh(), 
  3346.                 ProfileApplication(), GetROMBuild()
  3347.  
  3348.  
  3349. Task:    MemoryMonitorInit(pOnTarget := True)
  3350. Library:    MemoryMonitorOperations.lib
  3351. Header:
  3352. #########################################################################
  3353. #                        MemoryMonitorInit(pOnTarget)
  3354. #========================================================================
  3355. # Author:        KTA
  3356. # Description:    Makes a call to initialize MemoryMonitor.  Defalut is to 
  3357. #                initalize it on the Target.
  3358. # Parameters:    pOnTarget  - True means Memory Monitor will be initialized 
  3359. #                            on the Target.
  3360. #                            - False means Memory Monitor will be initialized 
  3361. #                            on the Host.
  3362. # Returns:        1 - initialization was successful.
  3363. #                0 - initialization failed
  3364. # Examples:        MemoryMonitorInit();
  3365. # Assumptions:    
  3366. #========================================================================
  3367. Calls:    _MemoryMonitor()
  3368. Is called by:    InstallEveryTimeMacro()
  3369.  
  3370.  
  3371. Task:    MemoryMonitorQuit()
  3372. Library:    MemoryMonitorOperations.lib
  3373. Header:
  3374. #########################################################################
  3375. #                        MemoryMonitorQuit()
  3376. #========================================================================
  3377. # Author:        KTA
  3378. # Description:    Makes a call to quit MemoryMonitor.  
  3379. # Parameters:    none
  3380. # Returns:        1 - quitting was successful.
  3381. #                0 - quitting failed
  3382. # Examples:        MemoryMonitorQuit();
  3383. # Assumptions:    
  3384. #========================================================================
  3385. Calls:    _MemoryMonitor()
  3386. Is called by:    InstallEveryTimeMacro()
  3387.  
  3388.  
  3389.  
  3390.  
  3391.  
  3392.  
  3393.  
  3394.  
  3395.  
  3396. ##############################################################
  3397. ##############################################################
  3398. ##############################################################
  3399. Library: Misc.Lib
  3400. Calls: "OutPut.Lib","LaunchQuit.Lib","TCS.Lib","UserInterface.Lib", "Geometry.Lib";
  3401.  
  3402.  
  3403. Task:    CenterofRectClick(pSpecifier := -1) 
  3404. Library:    Misc.Lib
  3405. Header:
  3406. #########################################################################
  3407. #                         CenterofRectClick(pSpecifier)
  3408. #=======================================================================
  3409. # Author:          KTA
  3410. # Description:    Clicks in the center of the input parameter <pSpecifier>
  3411. # Parameters:    pSpecifier
  3412. #                        -1 - indicates the screen
  3413. #                        integer <> -1 (or string) is a window specifier
  3414. #                        list - should be valid rectangle
  3415. # Returns:        Nada
  3416. #=======================================================================
  3417. Calls:    CenterPointOfRect(), findWindow(), LogStr()
  3418. Is called by:    AboutBox()
  3419.  
  3420.  
  3421. Task:    AboutBox(pDismissAboutBox := 0)
  3422. Library:    Misc.Lib
  3423. Header:
  3424. #########################################################################
  3425. #                 AboutBox(pDismissAboutBox)
  3426. #=======================================================================
  3427. # Author:          ML
  3428. # Description:    Test the About Box
  3429. # Parameters:    pDismissAboutBox -    -1    Escape key
  3430. #                                    0    Return key
  3431. #                                integer > 0    Click in center of screen {integer} times
  3432. #                                {string} select button named {string}
  3433. # Returns:        0 - Something failed
  3434. #                1 - Successfully selected and dismissed the about box.
  3435. #=======================================================================
  3436. Calls:    TCSStart(), SelectMenuItem(), LogStr(), TCSEnd(), SpecialKey(), 
  3437.         selectButton(), CenterofRectClick(), FindWindow(), 
  3438. Is called by:    DoCloseApp()
  3439.  
  3440.  
  3441.  
  3442.  
  3443.  
  3444.  
  3445.  
  3446.  
  3447.  
  3448. ##############################################################
  3449. ##############################################################
  3450. ##############################################################
  3451. Library: OnTargetOperations.Lib
  3452. Calls: "OnTarget.Lib", "ExceptionHandling.Lib";
  3453.  
  3454.  
  3455. Task:    _OnTarget(pServiceOrTask, pParamList := {}, pOnTarget := true, pIsRetry := 0)
  3456. Library:    OnTargetOperations.Lib
  3457. Header:
  3458. #########################################################################
  3459. #            _OnTarget(pServiceOrTask, pParamList, pOnTarget, pIsRetry)
  3460. #========================================================================
  3461. # Author:        KTA 
  3462. # Description:    Does the exception handling for the OnTarget.  All high level tasks
  3463. #                should call this routine for OnTarget tool services.  
  3464. #                Handles initialization of tool automatically.
  3465. # Parameters:    pServiceOrTask - Name of the Service
  3466. #                pParamList - List of parameters
  3467. #                pOnTarget - Flag to indicate whether the service should be performed 
  3468. #                            the host or the target.  1 = target/0 = host.
  3469. # Returns:        What ever the OnTarget returns - list of three elements
  3470. #                            { errCode, Data, [error message]}
  3471. # Examples:        _OnTarget('Initialize', {1});
  3472. # Assumptions:    None 
  3473. #========================================================================
  3474. Calls:    OnTarget(), ExceptionDispatcher(), _OnTarget(), 
  3475. Is called by:    PreFlight(), _OnTarget(), OnTargetInit(), FileShare(), 
  3476.                 CheckCache()
  3477.  
  3478.  
  3479. Task:    OnTargetInit()
  3480. Library:    OnTargetOperations.Lib
  3481. Header:
  3482. #########################################################################
  3483. #                     OnTargetInit()
  3484. #========================================================================
  3485. #
  3486. # Author:        GS
  3487. #
  3488. # Description:    Initializes OnTarget
  3489. # Parameters:    None
  3490. # Returns:        1 - if OnTarget launched and initialized
  3491. #                0 - if OnTarget could not launch
  3492. #
  3493. # Examples:        OnTargetInit()  
  3494. #
  3495. #========================================================================
  3496. Calls:    _OnTarget()
  3497. Is called by:    PreFlight(), FileShare(), CheckCache()
  3498.  
  3499.  
  3500.  
  3501.  
  3502.  
  3503.  
  3504.  
  3505.  
  3506.  
  3507. ##############################################################
  3508. ##############################################################
  3509. ##############################################################
  3510. Library: OutPut.Lib
  3511. Calls: 
  3512.  
  3513.  
  3514. Task:    LogStr(pTheString, pLogPriority := 5,pReportLibTask := 'RStatus') 
  3515. Library:    OutPut.Lib
  3516. Header:
  3517. #########################################################################
  3518. #                    LogStr(pTheString, pLogPriority,pReportLibTask)
  3519. #========================================================================
  3520. # Author:        KTA
  3521. # Description:    Match the target and print it with whatever is passed
  3522. #                to it in the 'str' parameter.  Set the appropriate 
  3523. #                LogPriority based on the context of the string.
  3524. # Parameters:    pTheString - string to be printed
  3525. #                LogPriority -    The priority of the string to be printed
  3526. #                0 - No logging
  3527. #                1 - Errors
  3528. #                2 - Comments and Notes
  3529. #                3 - Summary information
  3530. #                4 - More detailed
  3531. #                5 - Detailed description
  3532. # Returns:        Nothing
  3533. # Examples:        LogStr("It worked");
  3534. #                LogStr("It worked",3);
  3535. # Assumptions:        None 
  3536. #========================================================================
  3537. Calls:    gReportLibHooks, gLogStrHook2, gLogStrHook1, 
  3538. Is called by:    <<EVERYBODY>>; 
  3539.                 CrashHandling.Lib, DA.Lib, DoTasks.Lib, 
  3540.                 Draw.Lib, FileToolOperations.Lib, Finder.Lib, Font.Lib, 
  3541.                 Globals.Lib, LaunchQuit.Lib, Misc.Lib, Palette.Lib, 
  3542.                 Print.Lib, Select.Lib, StandardFile.Lib, TargetCheck.Lib, 
  3543.                 TCS.Lib, TimingOperations.lib, UserInterface.Lib, 
  3544.                 WorldReady.Lib
  3545.  
  3546.  
  3547.  
  3548.  
  3549.  
  3550.  
  3551.  
  3552.  
  3553.  
  3554. ##############################################################
  3555. ##############################################################
  3556. ##############################################################
  3557. Library: Palette.Lib
  3558. Calls: "TCS.Lib","Output.Lib","UserInterface.Lib", "ExceptionHandling.lib";
  3559.  
  3560. Task:    GetPalRect(palStruct)
  3561.         GetPalType(palStruct) 
  3562.         GetPalMatrixSize(palStruct)
  3563.         GetPalOffsets(palStruct)
  3564.         InsertPalRect(rect, pS)
  3565.         InsertPalOnDesk(onDesk, pS)
  3566. Library:    Palette.Lib
  3567. Header:
  3568. #########################################################################
  3569. #                            Palette Structure Accessors()
  3570. #========================================================================
  3571. # Author:        DM 
  3572. # Description:    These functions access the data in an palette data struct
  3573. # Parameters:    palStruct
  3574. # Returns:        the requested data element or list
  3575. #========================================================================
  3576. Calls:
  3577. Is called by:    CalcOffset(), SelFromDocWind(), SelFromPopUp(), 
  3578.                 SelFromMenuItemPopUp(), PalettePicker(), GetRandomElement()
  3579.  
  3580.  
  3581. Task:    GetElemNum(elemStruct)
  3582.         GetPalNum(elemStruct)
  3583.         GetElemName(elemStruct)
  3584.         GetElemType(elemStruct)
  3585.         GetElemDblClk(elemStruct)
  3586.         
  3587.         GetAttributes(elemStruct)
  3588.         GetSetAttribute(elemStruct)
  3589.         GetPatternFlag(elemStruct)
  3590.         GetLineFlag(elemStruct)
  3591.         GetColorFlag(elemStruct)
  3592.         GetGradientFlag(elemStruct)
  3593.         GetBackgroundColorFlag(elemStruct)
  3594.         GetTextColorFlag(elemStruct)
  3595.         GetPenPatternFlag(elemStruct)
  3596.         
  3597.         InsertElemNum(eNum, tS)
  3598.         InsertPalNum(pNum, tS)
  3599.         InsertElemName(eNam, tS)
  3600.         InsertElemType(eTyp, tS) 
  3601.         InsertElemDblClk(eDbc, tS)
  3602.         InsertSetAttribute(eDbc, tS)
  3603. Library:    Palette.Lib
  3604. Header:
  3605. #########################################################################
  3606. #                            Tool Structure Accessors()
  3607. #========================================================================
  3608. # Author:        DM 
  3609. # Description:    These functions access the data in an tool data struct
  3610. # Parameters:    elemStruct
  3611. # Returns:        the requested data element or list
  3612. #========================================================================
  3613. # History:
  3614. # ML    11/10/95    Added support for gradients, background colors, text colors,
  3615. #                    and pen patterns
  3616. #########################################################################
  3617. ## elemStruct is the data structure that completely specifies tools
  3618. ##            elemStruct    {
  3619. ##                ElemNum
  3620. ##                PalNum
  3621. ##                ElemName
  3622. ##                ElemType    - kClick := move-click 
  3623. ##                                        (Pointlist is single set of points)
  3624. ##                            - kDrag     := move-pressmouse-move-releasMouse 
  3625. ##                                        (Pointlist is two set of points)
  3626. ##                            == Pointlist is defined by Global gNumPoints ==
  3627. ##                            - kMultiDrag := move-pressmouse-move-move…releasMouse
  3628. ##                            - kMultiClick:= move-click-move-click-move…
  3629. ##                            - kMultiClickDragTool := move-pressmouse-move-releasMouse-pressmouse-move-releasMouse…
  3630. ##                            
  3631. ##                elemDblClk  - Flag to doulble click when finished
  3632. ##                            - 0 := No DoubleClick
  3633. ##                            - 1 := DoubleClick
  3634. ##
  3635. ##                SetAttribute  - Flag indicating when to set attributes
  3636. ##                            - 0 := No attributes to set
  3637. ##                            - 1 := Set attribute before drawing object
  3638. ##                            - 2 := Set attribute after drawing object
  3639. ##                            - "str" := Type <'Str'> after drawing object (texttool)
  3640. ##            }
  3641. ##        Defined ElemTypes:
  3642. ##                 
  3643. #########################################################################
  3644. ##    Example: global CharTool    :=     { ElemNum, PalNum,"ElemName", ElemType,    elemDblClk};
  3645. ##             global CharTool    :=     { 17     , 1     ,"Char"    , kClick  ,    0          };
  3646. #########################################################################
  3647. Calls:
  3648. Is called by:    << NOTE: each of the following tasks calls or defines 
  3649.                 a reference to 1 or more of the Tool Structure Accessor tasks. 
  3650.                 No task calls them all. >>
  3651.                 DrawObject(), CheckObjectStruct(), CalcOffset(), SelFromDocWind(), 
  3652.                 SelFromPalWind(), SelFromCoord(), SelFromPopUp(), 
  3653.                 SelFromMenuItemPopUp(), PalettePicker(), SetPointList(), 
  3654.                 SetAttributes()
  3655.  
  3656.  
  3657. Task:    PalettePicker(elemStruct := {}, ObjectNumber := 0)
  3658. Library:    Palette.Lib
  3659. Header:
  3660. #########################################################################
  3661. #                    PalettePicker(elemStruct) 
  3662. #========================================================================
  3663. # Author:            DM
  3664. # Description:        Dispatches selection request to palette handlers.  
  3665. # Parameters:        elemStruct:= Structure containing element info
  3666. #                                         Only the first 3 elements are required.
  3667. #                            kInWindPal := 1;
  3668. #                            kIsWindPal := 2;
  3669. #                            kPopUpPal := 4;
  3670. #
  3671. # Return Values:    1 -  OK
  3672. #                        0 - error
  3673. # Examples:            PalettePicker(elemStruct);
  3674. #========================================================================
  3675. Calls:    GetPalNum(), GetPalType(), SelFromCoord(), SelFromDocWind(), 
  3676.         SelFromPalWind(), SelFromPopUp(), SelFromMenuItemPopUp(), LogStr()
  3677. Is called by:    DrawObject(), SetTool(), SetPaletteItem(), CheckSetup()
  3678.  
  3679.  
  3680. Task:    CalcOffset(elemStruct)
  3681. Library:    Palette.Lib
  3682. Header:
  3683. #########################################################################
  3684. #                    CalcOffset(elemStruct) 
  3685. #========================================================================
  3686. # Author:            KTA
  3687. # Description:        Calculates tool offsets based on palette info.  
  3688. # Parameters:        elemStruct:= structure containing element info
  3689. # Return Values:    toolOffset:= {x,y}
  3690. #                        0 - error
  3691. # Examples:            CalcOffset(elemStruct);
  3692. #========================================================================
  3693. Calls:    GetPalNum(), GetPalType(), GetElemNum(), GetPalRect(), GetPalOffsets(), 
  3694.         GetPalMatrixSize(), Findwindow(), 
  3695. Is called by:    SelFromDocWind(), SelFromPalWind(), SelFromPopUp(), 
  3696.                 SelFromMenuItemPopUp()
  3697.  
  3698.  
  3699. Task:    SelFromDocWind(elemStruct, pObjectNumber)
  3700. Library:    Palette.Lib
  3701. Header:
  3702. #########################################################################
  3703. #                    SelFromDocWind(elemStruct) 
  3704. #========================================================================
  3705. # Author:            DM
  3706. # Description:        Selects tools from palettes that are builtin to doc windows.  
  3707. #                        You can also specify a Rect in Global coordinates outside
  3708. #                        the document window. 
  3709. # Parameters:        elemStruct
  3710. #                        pObjectNumber - Number to identify the elements required for
  3711. #                                            to draw the object.
  3712. # Return Values:    1 -  OK
  3713. #                        0 - error
  3714. # Examples:            SelFromDocWind(elemStruct);
  3715. #========================================================================
  3716. Calls:    GetPalNum(), GetPalRect(), GetElemNum(), GetElemName(), LogStr(), 
  3717.         TCSStart(), CalcOffset(), MoveMouse(), MoveRelativeToWindow(), 
  3718.         TCSEnd()
  3719. Is called by:    PalettePicker(), 
  3720.  
  3721.  
  3722. Task:    SelFromPalWind(elemStruct, pObjectNumber)
  3723. Library:    Palette.Lib
  3724. Header:
  3725. #########################################################################
  3726. #                    SelFromPalWind(elemStruct) 
  3727. #========================================================================
  3728. # Author:            DM
  3729. # Description:        Selects tools from palettes that are windows.  
  3730. # Parameters:        elemStruct:= structure containing element info
  3731. #                        pObjectNumber - Number to identify the elements required for
  3732. #                                            to draw object.
  3733. # Return Values:    1 -  OK
  3734. #                        0 - error
  3735. # Examples:            SelFromPalWind(elemStruct);
  3736. #========================================================================
  3737. Calls:    GetPalNum(), GetElemName(), GetElemNum(), LogStr(), TCSStart(), 
  3738.         CalcOffset(), MoveMouse(), TCSEnd(), 
  3739. Is called by:    PalettePicker()
  3740.  
  3741.  
  3742. Task:    SelFromCoord(elemStruct,ObjectNumber)
  3743. Library:    Palette.Lib
  3744. Header:
  3745. #########################################################################
  3746. #                    SelFromCoord(elemStruct, ObjectNumber) 
  3747. #========================================================================
  3748. # Author:            KTA
  3749. # Description:        Selects tools from coodinates either global or relative to the 
  3750. #                        front window.
  3751. # Parameters:        elemStruct:= structure containing tool info
  3752. # Return Values:    Returns what is returned by MoveRelativeToWindow() or MoveMouse()
  3753. # Examples:            SelFromCoord(elemStruct);
  3754. #========================================================================
  3755. Calls:    GetPalNum(), GetElemName(), GetElemNum(), LogStr(), TCSStart(), 
  3756.         MoveRelativeToWindow(), MoveMouse(), TCSEnd()
  3757. Is called by:    PalettePicker()
  3758.  
  3759.  
  3760. Task:    SelFromPopUp(elemStruct, pObjectNumber)
  3761. Library:    Palette.Lib
  3762. Header:
  3763. #########################################################################
  3764. #                    SelFromPopUp(elemStruct, pObjectNumber) 
  3765. #========================================================================
  3766. # Author:            DM
  3767. # Description:        Selects tools from palettes that pop up.  
  3768. # Parameters:        elemStruct:= structure containing element info
  3769. #                        pObjectNumber - Number to identify the elements required for
  3770. #                                            to draw the object.
  3771. # Return Values:    1 -  OK
  3772. #                        0 - error
  3773. # Examples:            SelFromPopUp(elemStruct);
  3774. #========================================================================
  3775. Calls:    GetPalNum(), GetPalRect(), GetElemNum(), GetElemName(), LogStr(), 
  3776.         TCSStart(), CalcOffset(), MoveMouse(), MoveRelativeToWindow(), 
  3777.         _PressMouse(), MoveMouse(), gSelFromPopUpHook, _ReleaseMouse(), TCSEnd()
  3778. Is called by:    PalettePicker()
  3779.  
  3780.  
  3781. Task:    SelFromMenuItemPopUp(elemStruct, pObjectNumber)
  3782. Library:    Palette.Lib
  3783. Header:
  3784. #########################################################################
  3785. #                    SelFromMenuItemPopUp(elemStruct) 
  3786. #========================================================================
  3787. # Author:            KTA
  3788. # Description:        Selects tools from palettes that pop up when selecting a 
  3789. #                        menuItem.  
  3790. # Parameters:        elemStruct:= structure containing element info
  3791. #                        pObjectNumber - Number to identify the elements required for
  3792. #                                            to draw the object.
  3793. # Return Values:    1 -  OK
  3794. #                        0 - error
  3795. # Examples:            SelFromMenuItemPopUp(elemStruct);
  3796. #========================================================================
  3797. Calls:    GetPalNum(), GetPalRect(),  GetElemNum(), GetElemName(), LogStr(), 
  3798.         TCSStart(), CalcOffset(), MoveMouse(), MoveRelativeToWindow(), 
  3799.         _PressMouse(), gSelFromMenuItemPopUpHook, _ReleaseMouse(), TCSEnd()
  3800. Is called by:    PalettePicker()
  3801.  
  3802.  
  3803. Task:    GetRandomElement(palStruct)
  3804. Library:    Palette.Lib
  3805. Header:
  3806. #########################################################################
  3807. #                        GetRandomElement()
  3808. #========================================================================
  3809. # Author:        DM 
  3810. # Description:    
  3811. # Parameters:    palStruct
  3812. # Returns:        
  3813. #========================================================================
  3814. Calls:
  3815. Is called by:    SetPaletteItem()
  3816.  
  3817.  
  3818.  
  3819.  
  3820.  
  3821.  
  3822.  
  3823.  
  3824.  
  3825. ##############################################################
  3826. ##############################################################
  3827. ##############################################################
  3828. Library: Print.Lib
  3829. Calls: "Output.Lib","TCS.Lib","UserInterface.Lib", "ExceptionHandling.Lib";
  3830.  
  3831.  
  3832.  
  3833. Task:    TestPageSetup(checkBoxTest := 1,paperSizeTest := 1,
  3834.         pageSizeTest := 1,orientationTest := 1,printTest := 0)
  3835. Library:    Print.Lib
  3836. Header:
  3837. #########################################################################
  3838. #    TestPageSetup(checkBoxTest,paperSizeTest,pageSizeTest,orientationTest,printTest)
  3839. #========================================================================
  3840. # Author:        EH
  3841. # Description:    Tests the standard page setup.  All permutations of 
  3842. #                checkboxes, paper radio buttons, scale controls, and 
  3843. #                orientation icons are selected.  
  3844. # Parameters:    checkBoxTest -    0 = do not test checkboxes
  3845. #                                    1 = test check boxes
  3846. #                paperSizeTest -    0 = do not test paper sizes
  3847. #                                1 = test paper sizes
  3848. #                pageSizeTest -    0 = do not test page sizes
  3849. #                                1 = test page sizes
  3850. #                orientationTest -    0 = do not test orientation
  3851. #                                    1 = test orientation
  3852. #                printTest -    0 = do not print after each combination
  3853. #                            1 = perform print test after each combination
  3854. # Returns:        0 = Error occured in testing
  3855. #                1 = Successful test
  3856. # Examples:        TestPageSetup(1,0,0,1,0);
  3857. # Assumptions:    A Page Setup dialog is up.
  3858. #========================================================================
  3859. Calls:    _matchBoolean(), LogStr(), TestCheckBoxList(), SelectButton()
  3860. Is called by:    
  3861.  
  3862.  
  3863. Task:    TestCheckBoxList(checkBoxList)
  3864. Library:    Print.Lib
  3865. Header:
  3866. #########################################################################
  3867. #                    TestCheckBoxList(printerParameters)
  3868. #========================================================================
  3869. # Author:        EH
  3870. # Description:    Selects all possible combinations of check boxes by
  3871. #                recursive calls to itself.  After each combination, it
  3872. #                calls PaperSize() which will result in all possible
  3873. #                combinations of check boxes, paper sizes, page sizes, and
  3874. #                orientations.
  3875. # Parameters:    checkBoxList -    A list of check box names
  3876. # Returns:        Nothing
  3877. #========================================================================
  3878. Calls:    PaperSize(), TestCheckBoxList(), SelectCheckBox()
  3879. Is called by:    TestPageSetup(), TestCheckBoxList()
  3880.  
  3881.  
  3882. Task:    PaperSize()
  3883. Library:    Print.Lib
  3884. Header:
  3885. #########################################################################
  3886. #                            PaperSize()
  3887. #========================================================================
  3888. # Author:        EH
  3889. # Description:    Selects all the paper size radio buttons.  After selecting
  3890. #                each button, it calls PageSize() to go through all possible
  3891. #                page sizes and then orientations.  This exercises all
  3892. #                possible combinations of paper size, page size, and 
  3893. #                orientation.
  3894. # Parameters:    None
  3895. # Returns:        Nothing
  3896. #========================================================================
  3897. Calls:    SelectRadioButton(), PageSize()
  3898. Is called by:    TestCheckBoxList()
  3899.  
  3900.  
  3901. Task:    PageSize()
  3902. Library:    Print.Lib
  3903. Header:
  3904. #########################################################################
  3905. #                                PageSize()
  3906. #========================================================================
  3907. # Author:        EH
  3908. # Description:    Selects the paper size in one of either three ways: Typing
  3909. #                values in a text edit field, selecting an up and down 
  3910. #                control, or by selecting radio buttons.  In between each
  3911. #                page size, this function calls ToggleOrientation.
  3912. # Parameters:    None
  3913. # Returns:        Nothing
  3914. #========================================================================
  3915. Calls:    _type(), TypeStr(), ToggleOrientation(), MoveRelativeToWindow(), LogStr(), 
  3916.         SelectRadioButton(), 
  3917. Is called by:    PaperSize()
  3918.  
  3919.  
  3920. Task:    ToggleOrientation()
  3921. Library:    Print.Lib
  3922. Header:
  3923. #########################################################################
  3924. #                    ToggleOrientation()
  3925. #========================================================================
  3926. # Author:        EH
  3927. # Description:    Toggles the portrait and landscape icons.
  3928. # Parameters:    None
  3929. # Returns:        Nothing
  3930. # Examples:        ToggleOrientation();
  3931. #========================================================================
  3932. Calls:    MoveRelativeToWindow(), LogStr(), PrintSample(), 
  3933. Is called by:    PageSize()
  3934.  
  3935.  
  3936. Task:    PrintSample()
  3937. Library:    Print.Lib
  3938. Header:
  3939. #########################################################################
  3940. #                    PrintSample()
  3941. #========================================================================
  3942. # Author:        EH
  3943. # Description:    Prints the current document and then reopens the pagesetup
  3944. #                dialog.
  3945. # Parameters:    None
  3946. # Returns:        Nothing
  3947. # Examples:        PrintSample();
  3948. #========================================================================
  3949. Calls:    SelectButton(), _match(), SelectMenuItem(), SpecialKey(), LogStr(), 
  3950.         _matchBoolean(), 
  3951. Is called by:    ToggleOrientation()
  3952.  
  3953.  
  3954. Task:    PrintAlert()
  3955. Library:    Print.Lib
  3956. Header:
  3957. #########################################################################
  3958. #                    PrintAlert() 
  3959. #========================================================================
  3960. # Author:            EH
  3961. # Description:        Logs the Static text from an alert dialog.
  3962. # Parameters:        none
  3963. # Return Values:    none
  3964. # Examples:            PrintAlert();
  3965. #========================================================================
  3966. Calls:    _collect,  LogStr()
  3967. Is called by:    
  3968.  
  3969.  
  3970. Task:    PageSetup(WhichDevice := "LaserWriter", PagSetupMI := {"Page Setup", "File"})
  3971. Library:    Print.Lib
  3972. Header:
  3973. ########################################################################
  3974. #                        PageSetup( WhichDevice )
  3975. #=======================================================================
  3976. # Author:             KTA
  3977. # Description:        For PageSetup routines
  3978. # Parameters:        WhichDevice - device
  3979. #                    PagSetupMI - pageSetup menuItem descriptor
  3980. # Returns:            None
  3981. #=======================================================================
  3982. Calls:    _Match(), TCSStart(), SelectMenuItem(), TCSEnd(), SpecialKey(),
  3983.         FindWindow()
  3984. Is called by:    DoCloseApp()
  3985.  
  3986.  
  3987. Task:    Printer(PrintMI := {"Print", "File"}) 
  3988. Library:    Print.Lib
  3989. Header:
  3990. ########################################################################
  3991. #                        Printer()
  3992. #=======================================================================
  3993. # Author:             KTA
  3994. # Description:        For Print routines
  3995. # Parameters:        PrintMI - menuItem descriptor
  3996. # Returns:            None
  3997. #=======================================================================
  3998. Calls:    TCSStart(), SelectMenuItem(), _match(), gPrinterHook, SpecialKey(), 
  3999.         FindWindow(), TCSEnd()
  4000. Is called by:    DoCloseApp()
  4001.  
  4002.  
  4003.  
  4004.  
  4005.  
  4006.  
  4007.  
  4008.  
  4009.  
  4010. ##############################################################
  4011. ##############################################################
  4012. ##############################################################
  4013. Library: Select.Lib
  4014. Calls: "UserInterface.Lib", "Output.Lib", "Geometry.Lib", "ExceptionHandling.Lib";
  4015.  
  4016.  
  4017.  
  4018. Task:    SelectIt(ProcID,PtorRect)
  4019. Library:    Select.Lib
  4020. Header:
  4021. #########################################################################
  4022. #                            SelectIt(ProcID,PtorRect)
  4023. #========================================================================
  4024. # Author:            SMQ 
  4025. #
  4026. # Description:        This routine performs multiple selection tests :
  4027. #
  4028. #                    #1    Selects a point.
  4029. #                    #2    Selects everything within a rectangle.
  4030. #                    #3    Selects everything from the current position to the 
  4031. #                        top of the file.
  4032. #                    #4    Selects everything from the current position to the
  4033. #                        bottom of the file.
  4034. #                    #5    Selects the entire file, i.e. everything from the
  4035. #                        top of the file to the bottom.
  4036. #
  4037. # Parameters:        ProcID - holds the procedure number
  4038. #                    PtorRect - holds Pt or Rect coordinates
  4039. #
  4040. # Returns:            0 - encountered an input error. ProcID not one of the choices or
  4041. #                        format of the PtorRect has an incorrect number of elements.
  4042. #
  4043. # Examples:            SelectIt(3,PtorRect)
  4044. #
  4045. # Assumptions:        Ruler is not shown
  4046. #========================================================================
  4047. Calls:    PointSelect(), RectSelect(), HereToStartSelect(), HereToEndSelect(), 
  4048.         SelectAll() 
  4049. Is called by:    
  4050.  
  4051.  
  4052. Task:    PointSelect (pPointList,pRelToWindow := 1, pSpecifier := 1) 
  4053. Library:    Select.Lib
  4054. Header:
  4055. #########################################################################
  4056. #            PointSelect (pPointList,pRelToWindow, pSpecifier)
  4057. #========================================================================
  4058. # Author:            SMQ
  4059. # Description:        This routine moves the mouse to the location specified
  4060. #                    by pPointList and clicks to select the point. 
  4061. # Parameters:        pPointList - List - holds the x-y coordinates of the point
  4062. #                    pRelToWindow - 1 - coords are relative to the window
  4063. #                                  0 - coords are absolutes, with respect 
  4064. #                                        to the screen.
  4065. #                    pSpecifier - Enables caller to specify the window the move 
  4066. #                                 will be relative to. (0 = document window)
  4067. # Returns:            what MoveRelativeToWindow() or MoveMouse() return
  4068. # Examples:            PointSelect ({120,100},1, 0)
  4069. # Assumptions:        
  4070. #========================================================================
  4071. Calls:    MoveRelativeToWindow(), MoveMouse(), 
  4072. Is called by:    SelectIt()
  4073.  
  4074.  
  4075. Task:    RectSelect (Rect,RelToWindow := 1)
  4076. Library:    Select.Lib
  4077. Header:
  4078. #########################################################################
  4079. #                    RectSelect (Rect,RelToWindow)
  4080. #========================================================================
  4081. # Author:            SMQ
  4082. # Description:        This routine selects the rectangle specified by Rect.
  4083. #                    It moves the mouse to the location specified by the
  4084. #                    first 2 elements in Rect and everything up to the 
  4085. #                    location specified by the next 2 elements.
  4086. # Parameters:        Rect - holds the left, top, right and bottom 
  4087. #                            coordinates of the rect.
  4088. #                    RelToWindow - 1 - coords are relative to the window
  4089. #                                  0 - coords are absolutes, with respect 
  4090. #                                        to the screen.
  4091. # Returns:            Nothing
  4092. # Examples:            RectSelect (Rect,1)
  4093. # Assumptions:        Ruler is not shown
  4094. #========================================================================
  4095. Calls:    MoveRelativeToWIndow(), _click(), MoveMouse(), 
  4096. Is called by:    SelectIt()
  4097.  
  4098.  
  4099. Task:    HereToStartSelect()
  4100. Library:    Select.Lib
  4101. Header:
  4102. #########################################################################
  4103. #                            HereToStartSelect()
  4104. #========================================================================
  4105. # Author:            SMQ
  4106. # Description:        This routine selects everything from the current 
  4107. #                    position to the start (Top) of the file.
  4108. # Parameters:        None
  4109. # Returns:            Nothing
  4110. # Examples:            HereToStartSelect()
  4111. # Assumptions:        Ruler is not shown, coordinates used are relative 
  4112. #                    to the window, as opposed to the screen.
  4113. #========================================================================
  4114. Calls:    GetVHScrollBars(), ScrollWindow(), _pressKey(), MoveRelativeToWindow(), 
  4115.         _click(), _releaseKey(), 
  4116. Is called by:    SelectIt()
  4117.  
  4118.  
  4119. Task:    HereToEndSelect()
  4120. Library:    Select.Lib
  4121. Header:
  4122. #########################################################################
  4123. #                            HereToEndSelect()
  4124. #========================================================================
  4125. # Author:            SMQ
  4126. # Description:        This routine selects everything from the current 
  4127. #                    position to the end (Bottom) of the file.
  4128. # Parameters:        None
  4129. # Returns:            Nothing
  4130. # Examples:            HereToEndSelect()
  4131. # Assumptions:        Ruler is not shown, coordinates used are relative 
  4132. #                    to the window, as opposed to the screen.
  4133. #========================================================================
  4134. Calls:    GetVHScrollBars(), ScrollWindow(), _pressKey(), ExceptionDispatcher(), 
  4135.         MoveRelativeToWindow(), _click(), _releaseKey()
  4136. Is called by:    SelectIt()
  4137.  
  4138.  
  4139. Task:    SelectAll()
  4140. Library:    Select.Lib
  4141. Header:
  4142. #########################################################################
  4143. #                            SelectAll()
  4144. #========================================================================
  4145. # Author:            SMQ
  4146. # Description:        This routine selects everything from the top of the
  4147. #                    frontmost window to the bottom.
  4148. # Parameters:        None
  4149. # Returns:            Nothing
  4150. # Examples:            SelectAll()
  4151. # Assumptions:        Ruler is not shown, coordinates used are relative 
  4152. #                    to the window, as opposed to the screen.
  4153. #========================================================================
  4154. Calls:    _match(), SelectMenuItem(), GetVHScrollBars(), ScrollWindow(), 
  4155.         MoveRelativeToWindow(), _click(), _pressKey(), ExceptionDispatcher(), 
  4156.         _releaseKey()
  4157. Is called by:    SelectIt()
  4158.  
  4159.  
  4160. Task:    RandomTextSelection(pSpecifier := 0, pWindowInset := {0,0,22,22})
  4161. Library:    Select.Lib
  4162. Header:
  4163. #########################################################################
  4164. #                RandomTextSelection(pSpecifier, pWindowInset)    
  4165. #========================================================================
  4166. # Author:        KTA
  4167. # Description:    Matches the current document window, clicks in a random location,
  4168. #                press the shiftkey, move to another random location and click.
  4169. #                This will select all text between the two random points.
  4170. # Parameters:    pSpecifier - window specifier.
  4171. #                pWindowInset - inset into the window for the content region
  4172. # Returns:        nothing
  4173. # Example:        RandomTextSelection();
  4174. #========================================================================
  4175. Calls:    findWindow(), getXYRandom(), MoveRelativeToWindow(), _pressKey(), 
  4176.         _releaseKey(), logStr()
  4177. Is called by:    
  4178.  
  4179.  
  4180.  
  4181.  
  4182.  
  4183.  
  4184.  
  4185.  
  4186. ##############################################################
  4187. ##############################################################
  4188. ##############################################################
  4189. Library: StandardFile.Lib
  4190. Calls:  "String.Lib","TCS.Lib","Output.Lib","UserInterface.Lib",
  4191. "ExceptionHandling.lib", "TargetCheck.Lib";
  4192.  
  4193.  
  4194.  
  4195. Task:    SaveAs(pNameDoc := "", pReplaceFlag := true, pSelectSaveAs := False, 
  4196.             pPathlist := global gSFPUTLocation, pCheckSaveDocWindow := 1) 
  4197. Library:    StandardFile.Lib
  4198. Header:
  4199. #########################################################################
  4200. #            SaveAs(pNameDoc, pReplaceFlag, pSelectSaveAs, pPathlist)
  4201. #========================================================================
  4202. # Author:        KTA
  4203. # Description:    This routine will type a name (pNameDoc) into the text edit
  4204. #                field.  Then it will press the ReturnKey to save the file.
  4205. #                If there is a document already named <pNameDoc> a dialog will
  4206. #                appear. If the <pReplaceFlag> evaluates to false
  4207. #                it will select NO to 'Replace Existing?' dialog. It will
  4208. #                then type the time (based on a 24 hour clock) after the
  4209. #                name and retype the ReturnKey. The Default is to replace
  4210. #                an existing document with the same name. It will also call
  4211. #                getNewFileName to create a file name if one is not provided.
  4212. # Parameters:    pNameDoc - string holding the name to name the document
  4213. #                pReplaceFlag - 0 to select 'No' to 'Replace Existing' dialog
  4214. #                              1 to select 'Yes' to replace exisiting file.
  4215. #                pSelectSaveAs - Flag which indicates whether or not to select
  4216. #                                SaveAs menuItem. 
  4217. #                                0 - Do not select SaveAs MenuItem
  4218. #                                1 - Select the SaveAs menuItem
  4219. #                                {List} - Select the SaveAs menuItem using the 
  4220. #                                        ord specified. e.g. {5,2}
  4221. #                pPathlist - Path to navigate before saving - should be complete path.
  4222. # Returns:        0 - Unable to dismiss SFPut or never present to begin with
  4223. #                1 - Dismissed SFPut ok, saved file, ReplaceExist not called
  4224. #                2 - Dismissed SFPut ok, saved file, ReplaceExist called
  4225. # Examples:        SaveAs('Untitled1'); to name the file 'Untitled1'
  4226. # Assumptions:    That the SF_Put dialog is present
  4227. #     
  4228. #========================================================================
  4229. Calls:    TCSStart(), selectmenuItem(), TCSEnd(), IsStandardFile(), _match(), 
  4230.         GetNewFileName(), TruncateString(), SFNavigate(), gSaveAsHook1, 
  4231.         TypeStr(), SpecialKey(), gReplaceExisting, _MatchBoolean(), 
  4232.         _collect(), ReplaceExist(), DialogCheck(), gSaveAsHook2, FindWindow(), 
  4233.         gSaveAsHook3, LogStr(),  
  4234. Is called by:    DoFiles(), DoCloseApp(), Quit(), Save(), TimeSaveAs(), CloseWindow()
  4235.  
  4236.  
  4237. Task:    OpenFile(pNameDoc := "", pSelectOpen := 1, pPathList :={}, pPartialPath := 0)
  4238. Library:    StandardFile.Lib
  4239. Header:
  4240. #########################################################################
  4241. #        OpenFile(pNameDoc,pSelectOpen, pPathList, pPartialPath)
  4242. #========================================================================
  4243. # Author:        KTA
  4244. # Description:    This routine will select 'Open' from the 'File' menu, type
  4245. #                the string held in the pNameDoc parameter, and
  4246. #                then press the returnkey.  It will check to see that
  4247. #                the frontmost window's title contains pNameDoc.  If not,
  4248. #                it assumes that the wrong file opened.  It will not select
  4249. #                'Open' if the pSelectOpen parameter is false.
  4250. # Parameters:    pNameDoc - string name of document to open
  4251. #                pSelectOpen - 0 to disable selecting of the 'Open' menu item.
  4252. #                             1 to select 'Open' from the 'File' menu
  4253. #                             2 keyEq - 'o'
  4254. #                            list - list containing ordinality of 'Open' menuItem.
  4255. #                pPathList - list defining path if file named <pNameDoc> not in
  4256. #                        the current directory
  4257. #                pPartialPath := Whether to start navigation at the current dir or 
  4258. #                                at the desktop
  4259. #                            1 - start at current directory
  4260. #                            0 - start at desktop (not partial)
  4261. # Returns:        1 - Document opened OK
  4262. #                0 - Document not opened OK
  4263. # Assumptions:    Works with SF_Get, but don't have pNameDoc be to long
  4264. #                of a string.
  4265. # Examples:        OpenFile('Untit'); will select a document such as 'Untitled'.
  4266. #========================================================================
  4267. Calls:    TCSStart(), selectmenuItem(), KeyEq(), IsStandardFile(), LogStr(), 
  4268.         SFNavigate(), gOpenFileHook1, TypeStr(), SpecialKey(), DialogCheck(), 
  4269.         gOpenFileHook2, FindWindow(), _match(), isSubString(), TCSEnd(), 
  4270. Is called by:    DoFiles(), TimeOpenFile()
  4271.  
  4272.  
  4273. Task:    SFNavigate( pPathList :={},pTEToggle :=0, pFinalReturn := 1, pPartialPath := 0) 
  4274. Library:    StandardFile.Lib
  4275. Header:
  4276. #########################################################################
  4277. #            SFNavigate(pPathList, pTEToggle, pFinalReturn, pPartialPath)    
  4278. #========================================================================
  4279. # Author:        KTA
  4280. # Description:    Controls the navigation in Standard File. 
  4281. #                Assigns a global gSFOriginalPath to the current directory 
  4282. #                for return navigation.
  4283. #                Passes all parameters to SFType which performs actual navigation.
  4284. # Parameters:    pPathList := List of directories beginning with the disk name.
  4285. #                            if pathlist := {} navigation will go to the Desktop.
  4286. #                            otherwise it should be in the form {'hd', 'folder'};
  4287. #                pTEToggle := Whether toggling from a text edit field is required 
  4288. #                            to navigate.
  4289. #                            1 - Toggle
  4290. #                            0 - No toggling required
  4291. #                pPartialPath := Whether to start navigation at the current dir or 
  4292. #                                at the desktop
  4293. #                            1 - start at current directory
  4294. #                            0 - start at desktop
  4295. #                pFinalReturn := Whether to accept the final item in <pPathList>
  4296. # Returns:        PathList
  4297. #                Also sets global gSFOriginalPath to the original path
  4298. #========================================================================
  4299. Calls:    IsStandardFile(), ExceptionDispatcher(), LogStr(), SFType(), 
  4300. Is called by:    ShimmerMateCopy(), SaveAs(), OpenFile()
  4301.  
  4302.  
  4303. Task:    SFType(pPathList,pTEToggle :=0, pFinalReturn := 1, pPartialPath := 0)
  4304. Library:    StandardFile.Lib
  4305. Header:
  4306. #########################################################################
  4307. #            SFType(pPathList, pTEToggle, pFinalReturn, pPartialPath)    
  4308. #========================================================================
  4309. # Author:        KTA
  4310. # Description:    Performs navigation in Standard File.
  4311. #                If <pPartialPath> evaluates to false, Selects the 'DeskTop' button.
  4312. #                Then types each item in <pPathList> followed by a returnKey.
  4313. # Parameters:    pPathList := List of directories beginning with the disk name.
  4314. #                pTEToggle := Whether toggling from a text edit field is required 
  4315. #                            to navigate.
  4316. #                            1 - Toggle
  4317. #                            0 - No toggling required
  4318. #                pPartialPath := Whether to start navigation at the current dir or 
  4319. #                                at the desktop
  4320. #                            1 - start at current dir
  4321. #                            0 - start at desktop
  4322. #                pFinalReturn := Whether to accept the final item in <pPathList>
  4323. # Returns:        Nada
  4324. #========================================================================
  4325. Calls:    _MatchBoolean(), SelectButton(), _type(), TypeList()
  4326. Is called by:    SFNavigate()
  4327.  
  4328.  
  4329. Task:    ReplaceExist( pReplaceFlag := true, pNameDoc :='') 
  4330. Library:    StandardFile.Lib
  4331. Header:
  4332. #########################################################################
  4333. #            ReplaceExist( pReplaceFlag,pNameDoc)    
  4334. #========================================================================
  4335. # Author:        KTA
  4336. # Description:    Handles the 'Replace existing?' dialog.
  4337. # Parameters:    pReplaceFlag - Whether to Replace a document with the same name
  4338. #                        or generate a unique name.
  4339. #                        1 - Overwrite document with same name.
  4340. #                        0 - Do not overwrite.  Generate unique name.
  4341. #                pNameDoc := Name of file which already exists on disk.
  4342. # Returns:        pNameDoc ( will be identical to the initial one if pReplaceFlag is set)
  4343. #========================================================================
  4344. Calls:    LogStr(), gReplaceExistHook1, _collect(), TCSStart(), SelectButton(), 
  4345.         TCSEnd(), GetNewFileName(), _type(), SpecialKey(), TruncateString(), 
  4346.         TypeStr(), gReplaceExistHook2
  4347. Is called by:    SaveAs(), 
  4348.  
  4349.  
  4350. Task:    GetNewFileName(pFileName :="",pIncludeNameFlag := 0)
  4351. Library:    StandardFile.Lib
  4352. Header:
  4353. #########################################################################
  4354. #                            GetNewFileName(pFileName, pIncludeNameFlag)    
  4355. #========================================================================
  4356. # Author:        SL
  4357. # Description:    Gets a new file name by concatenating the app name and
  4358. #                the current time.
  4359. # Parameters:    pFileName -    If this parameter is present, this routine will
  4360. #                        only pass back the time.  If this parameter is not
  4361. #                        present, then this routine will pass back a string
  4362. #                        consisting of the application name with the time
  4363. #                        appended to it.
  4364. #                pIncludeNameFlag - if true will append time and Sec to end of 
  4365. #                            name and return it.
  4366. # Returns:        newFileName - string name for new file name
  4367. #                    or just a time and Sec string
  4368. #========================================================================
  4369. Calls:    ExceptionDispatcher()
  4370. Is called by:    SaveAs(), ReplaceExist(), 
  4371.  
  4372.  
  4373. Task:    SFSelectPopupMenuItem( pPopupMenuItem := '')
  4374. Library:    StandardFile.Lib
  4375. Header:
  4376. #########################################################################
  4377. #             SFSelectPopupMenuItem(pPopupMenuItem) 
  4378. #========================================================================
  4379. # Author:        KTA
  4380. # Description:    Selects the popup menu item <pPopupMenuItem> from the Standard
  4381. #                File dialog.
  4382. # Parameters:    pPopupMenuItem -    The ordinality or Title of the menuitem (where
  4383. #                                the Displayed menuItem is ord 1 if using Ordinality).
  4384. # Returns:        nothing
  4385. # Examples:        SelectPopupMenuItem("Font");
  4386. #                SelectPopupMenuItem(2);
  4387. # Assumptions:    The popup menu is in window ord 1
  4388. #========================================================================
  4389. Calls:    IsStandardFile(), ExceptionDispatcher(), MoveMouse(), _pressMouse(), 
  4390.         _move(), _releaseMouse(), LogStr(), 
  4391. Is called by:    
  4392.  
  4393.  
  4394. Task:    ModifyDocument()
  4395. Library:    StandardFile.Lib
  4396. Header:
  4397. #########################################################################
  4398. #                        ModifyDocument()
  4399. #========================================================================
  4400. # Author:        KTA
  4401. # Description:    This task is called to modify a document so a revert to saved can
  4402. #                be performed.  If a global tqask reference (gModifyDocument) is 
  4403. #                defined, it will be called. Otherwise the default of typing a
  4404. #                string will be used.
  4405. # Parameters:    none
  4406. # Returns:        0 - failure
  4407. #                1 - success
  4408. # Examples:        ModifyDocument()
  4409. # Assumptions:    
  4410. #========================================================================
  4411. Calls:    TCSStart(), gModifyDocument, TypeStr(), TCSEnd()
  4412. Is called by:    DoFiles()
  4413.  
  4414.  
  4415. Task:    Revert(pRevertMI := '')
  4416. Library:    StandardFile.Lib
  4417. Header:
  4418. #########################################################################
  4419. #                        Revert(pRevertMI)
  4420. #========================================================================
  4421. # Author:        KTA
  4422. # Description:    If RevertMI is defined as the menuItem for revert it will be selected.
  4423. #                Otherwise a menuItem with the word 'Revert' in it will be selected. 
  4424. #                A dialog will normally appear confirming the revert request.  
  4425. #                Several methods will be used when attempting to dismiss the dialog.
  4426. #                Attempts to matck buttons "OK", "Yes", "Revert", are made, then 
  4427. #                typing the returnKey.  If RevertMi is defined then DialogCheck()
  4428. #                Will be called to output the static text in the dialog and the type
  4429. #                the returnKey.
  4430. # Parameters:    pRevertMI - List containing the ordinality of the revert menuItem. 
  4431. # Returns:        nada
  4432. # Examples:        Revert()
  4433. # Assumptions:    
  4434. #========================================================================
  4435. Calls:    TCSStart(), _matchBoolean(), SelectMenuItem(), SelectButton(), 
  4436.         SpecialKey(), DialogCheck(), ExceptionDispatcher(), logstr(), TCSEnd()
  4437. Is called by:    DoFiles()
  4438.  
  4439.  
  4440. Task:    IsStandardFile(pLogIt := 1)
  4441. Library:    StandardFile.Lib
  4442. Header:
  4443. #########################################################################
  4444. #                        IsStandardFile(pLogIt)
  4445. #========================================================================
  4446. # Author:        KTA
  4447. # Description:    Checks to see if the Standard File dialog is present
  4448. # Parameters:    pLogIt - Flag indicating whether or not to output
  4449. #                        the nonexistence of the StandardFile dialog.
  4450. # Returns:        1 - if the Standard File dialog is present
  4451. #                0 - if the Standard File dialog is not present
  4452. # Examples:        IsStandardFile()
  4453. # Assumptions:    
  4454. #========================================================================
  4455. Calls:    _matchBoolean(), _match(), _collect(), LogStr()
  4456. Is called by:    SaveAs(), OpenFile(), SFNavigate(), SFSelectPopupMenuItem(), 
  4457.                 CancelStandardFile(), Save(), CloseWindow()
  4458.  
  4459.  
  4460. Task:    CancelStandardFile(pHowCancel := 0, pSaveAsMenu := 0)
  4461. Library:    StandardFile.Lib
  4462. Header:
  4463. #########################################################################
  4464. #                        CancelStandardFile(pHowCancel, pSaveAsMenu)
  4465. #========================================================================
  4466. # Author:        KTA
  4467. # Description:    Selects Save As and Cancels it
  4468. # Parameters:    pHowCancel - method to cancel
  4469. #                    0 := KeyEq('.');
  4470. #                    1 := selectButton('Cancel');
  4471. #                    2 := SpecialKey(escapeKey,"Escape key");
  4472. #                pSaveAsMenu     -  list containing the ordinality of 'Save As' menu item.
  4473. #                            - anything else will cause the hardcoded string 'Save As'
  4474. #                                to be use in matching the menuItem.
  4475. # Returns:        1 - if cancelling occured as expected
  4476. #                0 - if it didn't
  4477. # Examples:        CancelStandardFile()
  4478. # Assumptions:    
  4479. #========================================================================
  4480. Calls:    TCSStart(), SelectMenuItem(), IsStandardFile(), KeyEq(), _matchBoolean(),
  4481.         selectButton(), SpecialKey(), TCSEnd(), 
  4482. Is called by:    DoFiles()
  4483.  
  4484.  
  4485. Task:    Save(pSaveMethod := 1)
  4486. Library:    StandardFile.Lib
  4487. Header:
  4488. #########################################################################
  4489. #                        Save(pSaveMethod)
  4490. #========================================================================
  4491. # Author:        KTA
  4492. # Description:    Selects Save - calls Save As if Standard File appears
  4493. # Parameters:    pSaveMethod - Method to save
  4494. #                    1 := Save from File Menu
  4495. #                    2 := Command-'s'
  4496. # Returns:        Nothing
  4497. # Examples:        Save()
  4498. # Assumptions:    
  4499. #========================================================================
  4500. Calls:    _matchBoolean(), TCSStart(), TCSEnd(), isStandardFile(), SaveAs(), keyEq()
  4501. Is called by:    DoFiles()
  4502.  
  4503.  
  4504.  
  4505.  
  4506.  
  4507.  
  4508.  
  4509.  
  4510.  
  4511. ##############################################################
  4512. ##############################################################
  4513. ##############################################################
  4514. Library: String.Lib
  4515. Calls: 
  4516.  
  4517.  
  4518.  
  4519. Task:    IsSubString(str1, str2)
  4520. Library:    String.Lib
  4521. Header:
  4522. #########################################################################
  4523. #                             IsSubString(str1, str2)
  4524. #=======================================================================
  4525. # Author:              SL
  4526. # Description:        Checks to see if str1 is in str2.
  4527. # Parameters:        str1    :=    Substring to be searched for.
  4528. #                    str2    :=    String.
  4529. # Returns:            0        :=    str1 is not in str2.
  4530. #                    1        :=    str1 is in str2.
  4531. #=======================================================================
  4532. Calls:
  4533. Is called by:    Twitcher(), LaunchByTypeSelect(), VerifyAppPriorToLaunch(), 
  4534.                 OpenFile(), DialogCheck()
  4535.  
  4536.  
  4537. Task:    PointListToStr(pointList := {})
  4538. Library:    String.Lib
  4539. Header:
  4540. #########################################################################
  4541. #                             PointListToStr(pts)
  4542. #=======================================================================
  4543. # Author:              DM
  4544. # Description:        Converts a list of points to a string.
  4545. # Parameters:        pt    :=    List of coordinate pairs.
  4546. # Returns:            0        :=    if the conversion fails.
  4547. #                    1        :=    The pt as a string.
  4548. #=======================================================================
  4549. Calls:
  4550. Is called by:    DrawObject()
  4551.  
  4552.  
  4553. Task:    FindPos(char, str, startPos:= 1)
  4554. Library:    String.Lib
  4555. Header:
  4556. #########################################################################
  4557. #                         FindPos(char, str, startPos)
  4558. #=======================================================================
  4559. # Author:          SL
  4560. # Description:    Finds the first occurence of char in str starting
  4561. #                from startPos.
  4562. # Parameters:    char    :=    A character to be searched for.
  4563. #                str        :=     String.
  4564. #                startPos:=    Starting position to be searched.
  4565. # Returns:        0        :=    Char is not in str starting from
  4566. #                            startPos.
  4567. #                pos        :=     Char position of its first occurence
  4568. #                            starting from startPos.
  4569. #=======================================================================
  4570. Calls:
  4571. Is called by:    
  4572.  
  4573.  
  4574. Task:    SubString(String,StartChar,NumChar)
  4575. Library:    String.Lib
  4576. Header:
  4577. #########################################################################
  4578. #                         Substring(String,StartChar,NumChar)
  4579. #=======================================================================
  4580. # Author:          PF 
  4581. # Description:    Returns the first <NumChar> characters of the passed <String>
  4582. #                starting at position <StartChar>.
  4583. # Parameters:    String - String to use
  4584. #                StartChar - integer - position of character to start making substring.
  4585. #                            new string will begin with character at this position.
  4586. #                NumChar - Integer number of characters to return
  4587. # Returns:        string
  4588. # Assumptions:    none
  4589. #=======================================================================
  4590. Calls:    Substring ()
  4591. Is called by:    Substring ()
  4592.  
  4593.  
  4594. Task:    RandomString(NumChar := 3)
  4595. Library:    String.Lib
  4596. Header:
  4597. #########################################################################
  4598. #                        RandomString( NumChar )
  4599. #========================================================================
  4600. # Author:        KTA 
  4601. # Description:    Generate Random strings <NumChar> long.
  4602. # Parameters:    NumChar := Length of random string to generate
  4603. # Returns:        The random string.
  4604. # Examples:        RandomString( 5 ); - Random String 5 characters in length
  4605. # Assumptions:    That you want Caps, lower case, numbers and punctuation
  4606. #========================================================================
  4607. Calls:    
  4608. Is called by:    TypeWord()
  4609.  
  4610.  
  4611. Task:    FormPositiveInteger(str, start_index := 1, end_index := -1)
  4612. Library:    String.Lib
  4613. Header:
  4614. ##############################################################
  4615. ##############################################################
  4616. Calls:
  4617. Is called by:    
  4618.  
  4619.  
  4620. Task:    CharToDigit(character)
  4621. Library:    String.Lib
  4622. Header:
  4623. ##############################################################
  4624. ##############################################################
  4625. Calls:
  4626. Is called by:    FormPositiveInteger()
  4627.  
  4628.  
  4629. Task:    StripCarriageReturn(pLine)
  4630. Library:    String.Lib
  4631. Header:
  4632. #########################################################################
  4633. #                    StripCarriageReturn(pLine)
  4634. #========================================================================
  4635. # Author:        KTA 
  4636. # Description:    returns a string that contains all of the characters in 
  4637. #                <pLine> up to but not including the carriage return.
  4638. # Parameters:    pLine - The line of text
  4639. # Returns:        string without the carriage return
  4640. # Examples:        StripCarriageReturn();
  4641. # Assumptions:    None 
  4642. #========================================================================
  4643. Calls:    StringUntilChar()
  4644. Is called by:    
  4645.  
  4646.  
  4647. Task:    StringUntilChar(pTheString, pTheChar, pIncludeTheChar := 0, 
  4648.         pNumOccurences := 1)
  4649. Library:    String.Lib
  4650. Header:
  4651. #########################################################################
  4652. #        StringUntilChar(pTheString, pTheChar, pIncludeTheChar, pNumOccurences)
  4653. #========================================================================
  4654. # Author:        KTA 
  4655. # Description:    returns a string that contains all of the characters in 
  4656. #                <pTheString> up to <pTheChar>. If <pIncludeTheChar> evaluates to
  4657. #                true <pTheChar> will be included in the returned string.
  4658. # Parameters:    pTheString - The string  
  4659. #                pTheChar - the character to search for
  4660. #                pIncludeTheChar - Boolean indicates whether or not to include 
  4661. #                                <pTheChar>.
  4662. #                pNumOccurences - indicates how many times <pChar> should occur
  4663. #                                prior to returning the string.
  4664. # Returns:        returns a string that contains all of the characters in 
  4665. #                <pTheString> up to (but not necessarily including) <pTheChar>. 
  4666. # Examples:        StringUntilChar();
  4667. # Assumptions:    None 
  4668. #========================================================================
  4669. Calls:
  4670. Is called by:    StripCarriageReturn()
  4671.  
  4672.  
  4673. Task:    NumTimesCharInString(pTheString, pTheChar)
  4674. Library:    String.Lib
  4675. Header:
  4676. #########################################################################
  4677. #                NumTimesCharInString(pTheString, pTheChar)
  4678. #========================================================================
  4679. # Author:        KTA 
  4680. # Description:    returns an integer that indicates the number of times <pChar>
  4681. #                occurs in <pTheString>.
  4682. # Parameters:    pTheString - The string  
  4683. #                pTheChar - the character to search for
  4684. # Returns:        returns an integer that indicates the number of times <pChar>
  4685. #                occurs in <pTheString>. 
  4686. # Examples:        NumTimesCharInString("hd:thisFolder:ThatFolder:FileName", ":");
  4687. # Assumptions:    None 
  4688. #========================================================================
  4689. Calls:
  4690. Is called by:    CopyFileToPath()
  4691.  
  4692.  
  4693. Task:    StringAfterChar(pTheString, pTheChar, pIncludeTheChar := 0, 
  4694.         pNumOccurences := 1)
  4695. Library:    String.Lib
  4696. Header:
  4697. #########################################################################
  4698. #        StringAfterChar(pTheString, pTheChar, pIncludeTheChar, pNumOccurences)
  4699. #========================================================================
  4700. # Author:        KTA 
  4701. # Description:    returns a string that contains all of the characters in 
  4702. #                <pTheString> after <pTheChar>. If <pIncludeTheChar> evaluates to
  4703. #                true <pTheChar> will be included in the returned string.
  4704. # Parameters:    pTheString - The string  
  4705. #                pTheChar - the character to search for
  4706. #                pIncludeTheChar - Boolean indicates whether or not to include 
  4707. #                                <pTheChar>.
  4708. #                pNumOccurences - indicates how many times <pChar> should occur
  4709. #                                prior to creating the returned string. 
  4710. # Returns:        returns a string that contains all of the characters in 
  4711. #                <pTheString> after <pTheChar>. 
  4712. # Examples:        StringAfterChar();
  4713. # Assumptions:    None 
  4714. #========================================================================
  4715. Calls:    
  4716. Is called by:    CopyFileToPath(), GetROMBuild()
  4717.  
  4718.  
  4719. Task:    TruncateString(pTheString, pNumChars)
  4720. Library:    String.Lib
  4721. Header:
  4722. #########################################################################
  4723. #                TruncateString(pTheString, pNumChars)
  4724. #========================================================================
  4725. # Author:        KTA 
  4726. # Description:    Truncates the string <pTheString> to be no more than <pNumChars>
  4727. #                in length.
  4728. # Parameters:    pTheString - The string  
  4729. #                pNumChars - the number of character desired.
  4730. # Returns:        returns a string which contains no more than <pNumChars> characters. 
  4731. # Examples:        TruncateString("HelloWorld", 4);
  4732. # Assumptions:    None 
  4733. #========================================================================
  4734. Calls:    
  4735. Is called by:    SaveAs(), ReplaceExist(), ConcatNameString()
  4736.  
  4737.  
  4738. Task:    ConcatNameString(pMainString, pAppendString, pMaxChars)
  4739. Library:    String.Lib
  4740. Header:
  4741. #########################################################################
  4742. #                ConcatNameString(pMainString, pAppendString, pMaxChars)
  4743. #========================================================================
  4744. # Author:        ML
  4745. # Description:    Concats a main string and append string, checking to see if
  4746. #                if falls withing allowable limits and truncating main string
  4747. #                if it doesn't.
  4748. # Parameters:    pMainString - The main string.  Will be truncated if
  4749. #                concatenated string is too long
  4750. #                pAppendString - the string to append.  Will not be truncated.
  4751. #                pMaxChars - the maximum number of characters allowed.
  4752. # Returns:        concatenated string.
  4753. # Examples:        TruncateString("Target Crash File", "1215", 31);
  4754. # Assumptions:    None 
  4755. #========================================================================
  4756. Calls:
  4757. Is called by:    GatherTargetCrashLog()
  4758.  
  4759.  
  4760.  
  4761.  
  4762.  
  4763.  
  4764.  
  4765.  
  4766.  
  4767. ##############################################################
  4768. ##############################################################
  4769. ##############################################################
  4770. Library: TargetCheck.Lib
  4771. Calls: 'Output.Lib', "MemoryMonitorOperations.lib", 
  4772. "Globals.Lib", "UserInterface.Lib", "TCS.Lib", "Gestalt.Lib", "OnTarget.Lib", 
  4773. "OnTargetOperations.Lib", "FileToolOperations.Lib",
  4774. "ExceptionHandling.Lib","String.Lib";
  4775.  
  4776.  
  4777.  
  4778. Task:    SystemFileInfo( pFileType )
  4779. Library:    TargetCheck.Lib
  4780. Header:
  4781. #########################################################################
  4782. #                            SystemFileInfo( pFileType )
  4783. #========================================================================
  4784. # Author:        ML
  4785. # Description:    Provides info on the targets system files
  4786. # Parameters:    pFileType:    'extn' - info on extensions
  4787. #                            'ctrl' - info on control panels
  4788. #                            'macs' - info on system folder root files
  4789. # Returns:        0 - Failure
  4790. #                List of list of file name, list of type, version, i.e.
  4791. #                {
  4792. #                    { 'PrintMonitor',{ 'APPL','7.1.2' } },
  4793. #                    ' EM Extension',{ 'INIT','3.0' } }, ...
  4794. #                }
  4795. #
  4796. # Examples:        SystemFileInfo('extn');
  4797. # Assumptions:    Finder Scripting Extension, program linking, guest access
  4798. #                must be installed and enabled on target for this task 
  4799. #                to succeed.
  4800. # Notes:        List returned is optimized for obtaining info based on file
  4801. #                name, i.e. assoc ("Monitors", SystemFileInfo( 'ctrl' ));
  4802. #                will return {type, version} of the Monitors cDev.
  4803. #========================================================================
  4804. Calls:    logstr(), 
  4805. Is called by:    
  4806.  
  4807.  
  4808. Task:    Restart(Time_to_restart := 25) 
  4809. Library:    TargetCheck.Lib
  4810. Header:
  4811. #########################################################################
  4812. #                            Restart()
  4813. #========================================================================
  4814. # Author:        RV
  4815. # Description:    Restarts and reaquires Targets
  4816. # Parameters:    None
  4817. # Returns:        1 - Success
  4818. #                0 - Failure
  4819. # Examples:        Restart();
  4820. # Assumptions:    None 
  4821. #========================================================================
  4822. Calls:    ExceptionDispatcher(), _select(), _collect(), _match(), _matchBoolean(), 
  4823.         LogStr(), 
  4824. Is called by:    
  4825.  
  4826.  
  4827. Task:    MatchApplication(logMe := 1, UpdateAppTitle :=1) 
  4828. Library:    TargetCheck.Lib
  4829. Header:
  4830. #########################################################################
  4831. #                     MatchApplication(logMe,UpdateAppTitle)
  4832. #========================================================================
  4833. # Author:            KTA
  4834. # Description:        This routine will match the current Application and,
  4835. #                    if the logMe parameter is 1, will log the current
  4836. #                    application name by passing it to LogStr().  If a
  4837. #                    parameter is not passed, the default behavior will
  4838. #                    log the application's title.  This routine will also
  4839. #                    set the global gAppTitle to the application's title.
  4840. #                    Output appears in the following format:
  4841. #                            The current application is "Finder"
  4842. # Parameters:        logMe - 1 to print the current application's title
  4843. #                            0 not to print the application's title
  4844. #                    UpdateAppTitle     - 1 to update the global AppTitle
  4845. #                                    - 0 not to update global AppTitle
  4846. # Return Value:        string holding current application's title
  4847. # Examples:            MatchApplication();
  4848. # Assumptions:        there is an active application
  4849. #========================================================================
  4850. Calls:    ExceptionDispatcher(), LogStr()
  4851. Is called by:    Scrapbook(), DoSetUpApp(), Twitcher(), MiniLaunch(), Quit(), 
  4852.                 LaunchTwitch()
  4853.  
  4854.  
  4855. Task:    RecordGetAboutThisMacintosh(pPhysicalRAM := 1, pLogicalRAM := 1, 
  4856.         pLargestUnusedBlock := 1,pSystemSize := 1, pAppName := global gApptitle)
  4857. Library:    TargetCheck.Lib
  4858. Header:
  4859. #########################################################################
  4860. #        RecordGetAboutThisMacintosh(pPhysicalRAM, pLogicalRAM, pLargestUnusedBlock, pSystemSize)
  4861. #========================================================================
  4862. # Author:        KTA
  4863. # Description:    Makes the calls to create TCSes which record the 
  4864. #                current Physical RAM, logical RAM, largest unused block, and system
  4865. #                size to a Phoenix output file.
  4866. # Parameters:    pPhysicalRAM - 1 Report PhysicalRAM size.
  4867. #                             - 0 Don't report PhysicalRAM size.
  4868. #                pLogicalRAM  - 1 Report LogicalRAM size.
  4869. #                             - 0 Don't report LogicalRAM size.
  4870. #                pLargestUnusedBlock  - 1 Report LargestUnusedBlock size.
  4871. #                                     - 0 Don't report LargestUnusedBlock size.
  4872. #                pSystemSize  - 1 Report system size.
  4873. #                             - 0 Don't report system size.
  4874. #                pAppName     - string name of app to get memory size of
  4875. #                             - 0 Don't report application size.
  4876. # Returns:        {list}       - List of sizes you've requested
  4877. #                    0         - unsuccessful
  4878. # Examples:        RecordGetAboutThisMacintosh();
  4879. # Assumptions:    
  4880. #========================================================================
  4881. Calls:    _MemoryMonitor(), TCSStart(), TCSEnd(), 
  4882. Is called by:    ProfileApplication(), SuiteStart()
  4883.  
  4884.  
  4885. Task:    FileShare()
  4886. Library:    TargetCheck.Lib
  4887. Header:
  4888. ##################################################################################
  4889. #                        FileShare()
  4890. #=======================================================================
  4891. # Author:        GS
  4892. # Description:    Checks to see if fileshare was installed and whether its switched on.
  4893. #
  4894. # Parameters:    None
  4895. # Returns:        On       :=   1
  4896. #                Off      :=   0
  4897. #                not Avail:=  -1
  4898. #                GestaltError
  4899. #=======================================================================
  4900. Calls:    OnTargetInit(), _OnTarget(), 
  4901. Is called by:    MachineState()
  4902.  
  4903.  
  4904. Task:    MachineState(printMachineState := 0, pUseXTools := 1)
  4905. Library:    TargetCheck.Lib
  4906. Header:
  4907. ##################################################################################
  4908. #                        MachineState()
  4909. #=======================================================================
  4910. # Author:        GS
  4911. # Description:    Returns a list of information concerning the state of the target 
  4912. #                machine.
  4913. #
  4914. # Parameters:    None
  4915. # Returns:        Gestalt Info
  4916. #=======================================================================
  4917. Calls:    ExceptionDispatcher(), _Gestalt(), CheckVM(), FileShare(), GetROMBuild(), 
  4918. Is called by:    BuildSuiteFields()
  4919.  
  4920.  
  4921. Task:    CheckCache()
  4922. Library:    TargetCheck.Lib
  4923. Header:
  4924. ##################################################################################
  4925. #                        CheckCache()
  4926. #=======================================================================
  4927. # Author:        GS
  4928. # Description:    Checks to see if caching is available and turned on, and returns 
  4929. #                a value.
  4930. #
  4931. # Parameters:    None
  4932. # Returns:        On         :=  1
  4933. #                Off        :=  0
  4934. #                not Avail :=  -1
  4935. #                GestaltError
  4936. #=======================================================================
  4937. Calls:    GestaltProcessorType(), OnTargetInit(), _OnTarget(), 
  4938. Is called by:    MachineState()
  4939.  
  4940.  
  4941. Task:    RecordMonitorInfo()
  4942. Library:    TargetCheck.Lib
  4943. Header:
  4944. #########################################################################
  4945. #        RecordMonitorInfo(pReturnList)
  4946. #========================================================================
  4947. # Author:        ML
  4948. # Description:    Makes the calls to create TCSes which record the 
  4949. #                target monitors' bit depth and coordinates
  4950. # Returns:        {list} - list of monitor info {{bit depth,{l,t,r,b}}}
  4951. #                     0 - unsuccessful
  4952. # Examples:        RecordMonitorInfo();
  4953. # Assumptions:    
  4954. #========================================================================
  4955. Calls:    _collect(), TCSStart(), TCSEnd(), 
  4956. Is called by:    SuiteStart()
  4957.  
  4958.  
  4959. Task:    ProfileApplication (appname:= global gApptitle)
  4960. Library:    TargetCheck.Lib
  4961. Header:
  4962. #########################################################################
  4963. #             ProfileApplication() 
  4964. #========================================================================
  4965. #
  4966. # Author:        ML
  4967. #
  4968. # Description:    Determines app process info, version info and
  4969. #                whether it is FAT, native, or 68k.
  4970. # Parameters:    appname - name of app in process list
  4971. # Returns:        none
  4972. # Examples:        AppInfo()
  4973. # Notes:        Requires Memory Monitor and Filetool on target and 
  4974. #                corresponding libs on the host.
  4975. #========================================================================
  4976. Calls:    _matchBoolean(), RecordGetAboutThisMacintosh(), _MemoryMonitor(), 
  4977.         _FileTool(), IsPowerPC(), 
  4978. Is called by:    DoSetUpApp()
  4979.  
  4980.  
  4981. Task:    GetROMBuild()
  4982. Library:    TargetCheck.Lib
  4983. Header:
  4984. #########################################################################
  4985. #             GetROMBuild() 
  4986. #========================================================================
  4987. # Description:    Reads the target ROM and returns the build of the ROM.
  4988. #                Note: this is not the ROM Version as returned by Gestalt.
  4989. #                Reads a short at offset 18 from ROM base @ 0x2AE+Ox12, then
  4990. #                returns the formatted results.
  4991. # Parameters:    none
  4992. # Returns:        Formated string which is the build of the ROM.
  4993. # Examples:        GetROMBuild()
  4994. # Notes:        Requires Memory Monitor version 1.0.5 or greater (reading 
  4995. #                ROM addresses was added to this build)
  4996. #========================================================================
  4997. Calls:    _MemoryMonitor(), NumToStr(), StringAfterChar(), 
  4998. Is called by:    MachineState()
  4999.  
  5000.  
  5001. Task:    IsPowerPC()
  5002. Library:    TargetCheck.Lib
  5003. Header:
  5004. #########################################################################
  5005. #                 IsPowerPC()
  5006. #=======================================================================
  5007. # Author:          KTA
  5008. # Description:    Makes a call to ProcessorType() to determine if the
  5009. #                target system is PowerPC or not
  5010. # Parameters:    none
  5011. # Returns:        0 - not PowerPC
  5012. #                1 - PowerPC
  5013. #=======================================================================
  5014. Calls:    GestaltSystemArchitecture()
  5015. Is called by:    PreFlight(), ProfileApplication()
  5016.  
  5017.  
  5018. Task:    IsSystem7()
  5019. Library:    TargetCheck.Lib
  5020. Header:
  5021. #########################################################################
  5022. #                 IsSystem7()
  5023. #=======================================================================
  5024. # Author:          KTA
  5025. # Description:    Makes a gestalt call to to determine if the
  5026. #                target system is system 7.0 or greater. 
  5027. # Parameters:    none
  5028. # Returns:        0 - not system 7.0 or greater
  5029. #                1 - system 7.0 or greater
  5030. #                Note: the global gIsSys7 will also be set as a side effect 
  5031. #                    of calling this task.
  5032. #=======================================================================
  5033. Calls:    _Gestalt()
  5034. Is called by:    Twitcher(), Quit(), LaunchTwitch(), SaveAs(), OpenFile(), 
  5035.                 InitTCSLogging()
  5036.  
  5037.  
  5038.  
  5039.  
  5040.  
  5041.  
  5042.  
  5043.  
  5044.  
  5045. ##############################################################
  5046. ##############################################################
  5047. ##############################################################
  5048. Library: TCS.Lib
  5049. Calls: "Utility.lib","UserInterface.Lib", "Results Express.lib", 
  5050.     "Globals.lib", "CrashHandling.lib", "String.Lib", "OutPut.Lib", 
  5051.     "TargetCheck.Lib", 'ExceptionHandling.Lib';
  5052.  
  5053.  
  5054.  
  5055. Task:    InitTCSLogging( pTestCaseLoggingMethod := global gTestCaseLoggingMethod )
  5056. Library:    TCS.Lib
  5057. Header:
  5058. #########################################################################
  5059. #                    InitTCSLogging(pSetupFileToolOutput)
  5060. #========================================================================
  5061. # Author:        KTA 
  5062. # Description:    Initializes globals and <Constants> necessary for generating
  5063. #                database records known as TCS (Test Case Specification) records.
  5064. # Parameters:    pTestCaseLoggingMethod - The logging method
  5065. # Returns:        Nothing
  5066. # Examples:        InitTCSLogging(1,1);
  5067. # Assumptions:    None 
  5068. #========================================================================
  5069. Calls:    ExceptionDispatcher(), IsSystem7(), SetUpOutput()
  5070. Is called by:    SuiteStart()
  5071.  
  5072.  
  5073. Task:    SuiteStart(pScriptName := '', pScriptParamList := '', 
  5074.         pScriptVersion := 'xxx', pMatrixID := 0, pUseXTools := 1 )
  5075. Library:    TCS.Lib
  5076. Header:
  5077. #########################################################################
  5078. #                SuiteStart(pScriptName, pScriptParamList, pScriptVersion)
  5079. #========================================================================
  5080. # Author:        GS 
  5081. # Description:    Start Suite Record.
  5082. # Parameters:    pScriptName - Name of the current script 
  5083. #                pScriptParamList - list of VU parameters for the current execution
  5084. #                pScriptVersion - version of the current script
  5085. #                pMatrixID - Id for the matrix.
  5086. #                pUseXTools - Flag which indicates whether its ok to use external tools
  5087. #                            when building the suite header, Ontarget is used to determine if
  5088. #                            filesharing in ON, MemoryMonitor is used to read the ROMBuild.
  5089. # Returns:        Nothing
  5090. # Examples:        SuiteStart("MacDraw.vu", {1}, '1.1.2');
  5091. # Assumptions:    None 
  5092. #========================================================================
  5093. Calls:    InitGlobals(), InitTCSLogging(), InstallEveryTimeMacro(), gSuiteStartHook, 
  5094.         LogStr(), BuildSuiteFields(), RecordMonitorInfo(), 
  5095.         RecordGetAboutThisMacintosh(), BeginTimer()
  5096. Is called by:    
  5097.  
  5098.  
  5099. Task:    SuiteEnd(pCompletionCode := 1, pCheckIfSystemFailed := 1)
  5100. Library:    TCS.Lib
  5101. Header:
  5102. #########################################################################
  5103. #                            SuiteEnd(pCompletionCode)
  5104. #========================================================================
  5105. # Author:        GS 
  5106. # Description:    End Suite Record. 
  5107. # Parameters:    pCompletionCode - Code which indicates success of suite 
  5108. #                                1 - Completed successfully
  5109. #                                0 - Completed unsuccessfully
  5110. # Returns:        Nothing
  5111. # Examples:        SuiteEnd(1);
  5112. # Assumptions:    none 
  5113. #     Additional information concerning global gAdditionalSuiteInfoFT:
  5114. #     gAdditionalSuiteInfoFT has been provided to allow additonal information to be written
  5115. #     to the suite block.  If there is additonal information that needs to be written to
  5116. #    the suite block, gAdditionalSuiteInfoFT needs to be defined as a formatted string. 
  5117. #    The string should be defined as 1 or more Phoenix data fields.
  5118. #    Each new field should be in the form of "∂t∂t<FieldLabel>:∂t<FieldData>∂n"
  5119. #     If there are multiple fields that need to be returned, they should be
  5120. #     concatenated and returned as a single string. Note: the default setting is that
  5121. #    gAdditionalSuiteInfoFT is undefined and thus nothing will be added to the suite footer
  5122. #    unless explicitly defined.
  5123. #========================================================================
  5124. Calls:    CheckforSystemFailure(), GetCurrentTime(), ExceptionDispatcher(), 
  5125.         EqualREIDs(), AddSuiteFields(), LogStr(), gSuiteEndHook, gSuiteEndThreadingHook
  5126. Is called by:    CleanAbort()
  5127.  
  5128.  
  5129. Task:    TCSStart(pTCSId, pTextDesc, pAppName := global gAppTitle, pTargetAlive := 1)
  5130. Library:    TCS.Lib
  5131. Header:
  5132. #########################################################################
  5133. #                            TCSStart(pTCSId, pTextDesc, pAppName)
  5134. #========================================================================
  5135. # Author:        GS 
  5136. # Description:    Start TCS Record.
  5137. # Parameters:    pTCSId -  The TCS Id that results are being recorded for (list)
  5138. #                            1st element - Test Case number  (integer)
  5139. #                            2nd element - Test Case Set        (string)
  5140. #                            3rd element - Test Case Type    (string)
  5141. #                            4th element - Test Case Owner    (string)
  5142. #                pTextDesc - string that describes the Test Case
  5143. #                pAppName - defaults to gAppTitle, otherwise the name of the 
  5144. #                            application the Test Case applies to
  5145. # Returns:        Nothing
  5146. # Examples:        TCSStart();
  5147. # Assumptions:    None 
  5148. #========================================================================
  5149. Calls:    gTCSStartHook1, LogStr(), FillTCSId(), ExceptionDispatcher(), TCSPush(), 
  5150.         ApplicationVerification()
  5151. Is called by:    GatherTargetCrashLog(), DefaultCrashHandler(), Scrapbook(), 
  5152.                 DoSetUpApp(), DrawObject(), UseClickTool(), UseDragTool(), 
  5153.                 UseDragClickTool(), UseMultiDragTool(), UseMultiClickTool(), 
  5154.                 UseMultiClickDragTool(), UseDragOffTool(), SetLineMenuItems(), 
  5155.                 SetFont(), SetStyle(), SetSize(), ReportSelectedMenuItems(), 
  5156.                 Twitcher(), Quit(), QuitBackgroundApps(), LaunchByAppleMenu(), 
  5157.                 LaunchByTypeSelect(), LaunchTwitch(), AboutBox(), SelFromDocWind(), 
  5158.                 SelFromPalWind(), SelFromCoord(), SelFromPopUp(), SelFromMenuItemPopUp(), 
  5159.                 PageSetup(), Printer(), SaveAs(), OpenFile(), ReplaceExist(), 
  5160.                 ModifyDocument(), Revert(), CancelStandardFile(), Save(), 
  5161.                 RecordGetAboutThisMacintosh(), RecordMonitorInfo(), LogPerformanceResults(), 
  5162.                 DragAcrossScreens(), SizeAcrossScreens(), DragWindow(), SizeWindow(), 
  5163.                 ZoomWindow(), CloseWindow(), ScrollWindow()
  5164.  
  5165.  
  5166. Task:    TCSEnd(pTCSId := {}, pResultCode := '', pErrStr := '', pTCSVal := '', 
  5167.         pTCSStr := '', pCommentStr := '', pBailFlag := '')
  5168. Library:    TCS.Lib
  5169. Header:
  5170. #########################################################################
  5171. #        TCSEnd(pTCSId,pResultCode, pErrStr, pTCSVal, pTCSStr, pCommentStr)
  5172. #========================================================================
  5173. # Author:        GS 
  5174. # Description:    This task is called when the functionality of the pending TCS 
  5175. #                is complete.  It will pop the top TCS record from the TCS stack,
  5176. #                check to insure the TCS numbers match.  If the result code (<pResultCode>)
  5177. #                is 0 a check will be done to insure no unexpected dialogs are present.
  5178. #                A call to ExceptionDispatcher() is made to insure that no VU errors were 
  5179. #                encountered. Then the appropriate output task is called to output the 
  5180. #                data.  
  5181. # Parameters:    pTCSId -  The TCS Id that results are being recorded for (list)
  5182. #                            1st element - Test Case number  (integer)
  5183. #                            2nd element - Test Case Set        (string)
  5184. #                            3rd element - Test Case Type    (string)
  5185. #                            4th element - Test Case Owner    (string)
  5186. #                pResultCode - The result of the TCS on top of Stack (Lifo)
  5187. #                pErrStr - Reason for failure if known.
  5188. #                pTCSVal - Any value a TCS needs to return for additional info.
  5189. #                pTCSStr - Any string a TCS needs to return for additional info.
  5190. #                pCommentStr - A string the TCS can return results in.
  5191. #                pBailFlag     - incase of critical error we may need to dump the stack
  5192. #                                - 'NoRecursion' this will avoid recursion 
  5193. #                                - any integer will bail the suite with the value of the integer    
  5194. # Returns:        Nothing
  5195. # Examples:        TCSEnd();
  5196. # Assumptions:    None 
  5197. #========================================================================
  5198. Calls:    gTCSEndHook1, TopOfTCSStack(), TCTrackingOrNot(), CheckforSystemFailure(), 
  5199.         TCSPop(), gExitVU, DialogHandler(), gLastResortHook, PrintTCSRecord(), 
  5200.         EqualREIDs(), BuildTCSFields(), NewTestCase(), CleanAbort(), gTCSEndThreadingHook
  5201. Is called by:    GatherTargetCrashLog(), DefaultCrashHandler(), Scrapbook(), 
  5202.                 DoSetUpApp(), DrawObject(), UseClickTool(), UseDragTool(), 
  5203.                 UseDragClickTool(), UseMultiDragTool(), UseMultiClickTool(), 
  5204.                 UseMultiClickDragTool(), UseDragOffTool(), SetLineMenuItems(), 
  5205.                 SetFont(), SetStyle(), SetSize(), ReportSelectedMenuItems(), 
  5206.                 Twitcher(), Quit(), QuitBackgroundApps(), LaunchByAppleMenu(), 
  5207.                 LaunchByTypeSelect(), LaunchTwitch(), AboutBox(), 
  5208.                 SelFromDocWind(), SelFromPalWind(), SelFromCoord(), 
  5209.                 SelFromPopUp(), SelFromMenuItemPopUp(), PageSetup(), 
  5210.                 Printer(), SaveAs(), OpenFile(), ReplaceExist(), 
  5211.                 ModifyDocument(), Revert(), CancelStandardFile(), Save(), 
  5212.                 RecordGetAboutThisMacintosh(), RecordMonitorInfo(), 
  5213.                 ClearStack(), LogPerformanceResults(), DragAcrossScreens(), 
  5214.                 SizeAcrossScreens(), DragWindow(), SizeWindow(), 
  5215.                 ZoomWindow(), CloseWindow(), ScrollWindow()
  5216.  
  5217.  
  5218. Task:    SetUpOutput()
  5219. Library:    TCS.Lib
  5220. Header:
  5221. #########################################################################
  5222. #                        SetUpOutput()
  5223. #========================================================================
  5224. # Author:        KTA
  5225. # Description:    if global gTestCaseLoggingMethod = global kTCSResultsExpressMethod
  5226. #                ResultsExpress will be initialized.
  5227. # Parameters:    none
  5228. # Returns:        Nothing
  5229. # Examples:        SetUpOutput(1);
  5230. # Assumptions:    
  5231. #========================================================================
  5232. Calls:    
  5233. Is called by:    InitTCSLogging()
  5234.  
  5235.  
  5236. Task:    FillTCSId( pTCSId )
  5237. Library:    TCS.Lib
  5238. Header:
  5239. #########################################################################
  5240. #                            FillTCSId( pTCSId )
  5241. #========================================================================
  5242. # Author:        naga
  5243. # Description:    Start TCS Record.
  5244. # Parameters:    pTCSId
  5245. # Returns:        new complete TCSId ( a list of 4 elements)
  5246. # Examples:        newId := FillTCSId( oldId );
  5247. # Assumptions:    None 
  5248. #========================================================================
  5249. Calls:    
  5250. Is called by:    TCSStart()
  5251.  
  5252.  
  5253. Task:    PrintTCSRecord(pTCSRecord, pResultCode, pErrStr, pTCSVal, pTCSStr, pCommentStr)
  5254. Library:    TCS.Lib
  5255. Header:
  5256. #########################################################################
  5257. #        PrintTCSRecord(pTCSRecord, pResultCode, pErrStr, pTCSVal, pTCSStr, pCommentStr)
  5258. #========================================================================
  5259. # Author:        KTA 
  5260. # Description:    Prints TCS record information to the notebook.
  5261. # Parameters:    pTCSRecord - The current TCS Record from top of stack
  5262. #                pResultCode - Result of the TCS
  5263. #                pCommentStr - String provided for returning results
  5264. #                pTCSVal - field for TCS specific values
  5265. #                pTCSStr - field for TCS specific strings
  5266. #                pErrStr - String for explaining failure
  5267. # Returns:        Nothing
  5268. # Examples:        PrintTCSRecord();
  5269. # Assumptions:    None 
  5270. #========================================================================
  5271. Calls:    
  5272. Is called by:    TCSEnd()
  5273.  
  5274.  
  5275. Task:    BuildSuiteFields( pScriptName := 'na', pScriptVersion := 'na', 
  5276.         pScriptParameterList := "", pUseXTools := 1)
  5277. Library:    TCS.Lib
  5278. Header:
  5279. #########################################################################
  5280. #        BuildSuiteFields( pScriptName, pScriptVersion, pScriptParameterList, pUseXTools)
  5281. #========================================================================
  5282. # Author:        RV
  5283. # Description:    Outputs suite header information utilizing Results Express
  5284. # Parameters:    pScriptName         - Name of the current script
  5285. #                pScriptVersion         - Version of the current script
  5286. #                pScriptParameterList - Parameters to the current script
  5287. #                pUseXTools -Flag which indicates whether its ok to use external tools
  5288. #                            when building the suite header, Ontarget is used to determine if
  5289. #                            filesharing in ON, MemoryMonitor is used to read the ROMBuild.
  5290. # Returns:        Nothing
  5291. # Examples:        LogSuiteHeader("MacDraw", '1.0',{1});
  5292. # Assumptions:    None 
  5293. #========================================================================
  5294. Calls:    MachineState(), ExceptionDispatcher(), GetCurrentTime(), 
  5295. Is called by:    SuiteStart()
  5296.  
  5297.  
  5298. Task:    BuildTCSFields(pTCSRecord, pResultCode, pErrStr, pTCSVal, pTCSStr, pCommentStr )
  5299. Library:    TCS.Lib
  5300. Header:
  5301. #########################################################################
  5302. #    BuildTCSFields(pTCSRecord, pResultCode, pErrStr, pTCSVal, pTCSStr, pCommentStr )
  5303. #========================================================================
  5304. # Author:        RV
  5305. # Description:    Builds a list of fields for the TCS record for use with Results Express.
  5306. # Parameters:    pTCSRecord - The current TCS Record from top of stack
  5307. #                pResultCode - Result of the TCS
  5308. #                pCommentStr - String provided for returning results
  5309. #                pTCSVal - field for TCS specific values
  5310. #                pTCSStr - field for TCS specific strings
  5311. #                pErrStr - String for explaining failure
  5312. # Returns:        list of fields (e.g. list of Label/Value pairs)
  5313. # Examples:        BuildTCSFields(thisTCS,1);
  5314. # Assumptions:    None 
  5315. #========================================================================
  5316. Calls:    
  5317. Is called by:    TCSEnd()
  5318.  
  5319.  
  5320. Task:    TopOfTCSStack()
  5321. Library:    TCS.Lib
  5322. Header:
  5323. #########################################################################
  5324. #                    TopOfTCSStack()
  5325. #========================================================================
  5326. # Author:        KTA 
  5327. # Description:    Returns the top element of TCS stack.
  5328. # Parameters:    nothing
  5329. #                
  5330. # Returns:        thisTCS - TCS from the top of the stack
  5331. # Examples:        myTCS := TopOfTCSStack();
  5332. # Assumptions:    None 
  5333. #========================================================================
  5334. Calls:    
  5335. Is called by:    TCSEnd()
  5336.  
  5337.  
  5338. Task:    TCSPop()
  5339. Library:    TCS.Lib
  5340. Header:
  5341. #########################################################################
  5342. #                    TCSPop()
  5343. #========================================================================
  5344. # Author:        KTA 
  5345. # Description:    Pops the top element from the stack and returns it.
  5346. # Parameters:    nothing
  5347. #                
  5348. # Returns:        thisTCS - TCS record from the top of the stack
  5349. # Examples:        myTCS := TCSPop();
  5350. # Assumptions:    None 
  5351. #========================================================================
  5352. Calls:
  5353. Is called by:    TCSEnd()
  5354.  
  5355.  
  5356. Task:    TCSPush(pThisTCS)
  5357. Library:    TCS.Lib
  5358. Header:
  5359. #########################################################################
  5360. #                    TCSPush(pThisTCS)
  5361. #========================================================================
  5362. # Author:        KTA 
  5363. # Description:    Push <pThisTCS> onto the stack
  5364. # Parameters:    pThisTCS - TCS record to push onto the stack
  5365. #                
  5366. # Returns:        Nothing
  5367. # Examples:        TCSPush(myTCS);
  5368. # Assumptions:    None 
  5369. #========================================================================
  5370. Calls:
  5371. Is called by:    TCSStart()
  5372.  
  5373.  
  5374. Task:    ClearStack(pAbortReason := '')
  5375. Library:    TCS.Lib
  5376. Header:
  5377. #########################################################################
  5378. #                    ClearStack(pFailReason)
  5379. #========================================================================
  5380. # Author:        KTA 
  5381. # Description:    Pops all of the TCSes from the TCS stack appropriately failing
  5382. #                them with an error code of -1 
  5383. # Parameters:    pFailReason - Reason for failing TCS that is at the top of the stack.
  5384. # Returns:        Nothing
  5385. # Examples:        ClearStack('I wanted to');
  5386. # Assumptions:    None 
  5387. #========================================================================
  5388. Calls:    TCSEnd()
  5389. Is called by:    DefaultCrashHandler(), CleanAbort()
  5390.  
  5391.  
  5392. Task:    CleanAbort(pAbortReason := '', pSuiteComplete := 0)
  5393. Library:    TCS.Lib
  5394. Header:
  5395. #########################################################################
  5396. #        CleanAbort(pFailReason, pSuiteComplete := 0)
  5397. #========================================================================
  5398. # Author:        GS 
  5399. # Description:    Dumps the TCS stack appropriately failing the TCS's that 
  5400. #                couldn't be completed. Then releases the target, and exits 
  5401. #                the script
  5402. # Parameters:    pFailReason - Reason for failing TCS.
  5403. #                pSuiteComplete - Completion Code for Suite.
  5404. # Returns:        Nothing
  5405. # Examples:        CleanAbort();
  5406. # Assumptions:    None 
  5407. #========================================================================
  5408. Calls:    ClearStack(), SuiteEnd(), gExitVU
  5409. Is called by:    GatherTargetCrashLog(), TCSEnd(),  ApplicationVerification()
  5410.  
  5411.  
  5412. Task:    ApplicationVerification(pAppVerify := 0)
  5413. Library:    TCS.Lib
  5414. Header:
  5415. #########################################################################
  5416. #                ApplicationVerification(pAppVerify)
  5417. #========================================================================
  5418. # Author:        KTA 
  5419. # Description:    Verify that the current Application is the same as the global
  5420. #                gAppTitle.  If not successfull, Abort of script will occur thru
  5421. #                ExceptionDispatcher().
  5422. # Parameters:    pAppVerify - 1 := will make the check
  5423. #                            0 := will not make the check
  5424. # Returns:        nothing
  5425. # Examples:        ApplicationVerification(1);
  5426. # Assumptions:    None 
  5427. #========================================================================
  5428. Calls:    LogStr(), _Match(), ExceptionDispatcher(), KeyEq(), CleanAbort(), 
  5429. Is called by:    TCSStart()
  5430.  
  5431.  
  5432. Task:    TCTrackingOrNot(pTCID)
  5433. Library:    TCS.Lib
  5434. Header:
  5435. #########################################################################
  5436. #            TCTrackingOrNot(pTCID)
  5437. #========================================================================
  5438. # Author:        KTA 
  5439. # Description:    Determines if individual TCSes should be tracked or not by 
  5440. #                comparing the value of <pTCID> with the global gTCTracking.
  5441. #                    If gTCTracking = 0 - no Test Cases will be tracked.
  5442. #                    If gTCTracking = 1 - all Test Cases will be tracked.
  5443. #                    If gTCTracking = <list> - only the Test Cases that have a pTCID
  5444. #                        which is in the list will be tracked.
  5445. #                
  5446. # Parameters:    pTCID - The pTCID from a call to TCSStart and/or TCSEnd
  5447. # Returns:        0 - don't perform Test Case tracking
  5448. #                1 - perform Test Case tracking
  5449. # Examples:        TCTrackingOrNot("Performance");
  5450. # Assumptions:    
  5451. #========================================================================
  5452. Calls:    
  5453. Is called by:    TCSStart(), TCSEnd()
  5454.  
  5455.  
  5456. Task:    CheckforSystemFailure()
  5457. Library:    TCS.Lib
  5458. Header:
  5459. #########################################################################
  5460. #                CheckforSystemFailure()
  5461. #========================================================================
  5462. # Author:        KTA 
  5463. # Description:    Check for a system failure and calls Logs a testcase there was one.
  5464. # Parameters:    none
  5465. # Returns:        Nothing - But will call TCSEnd with the suitebailflag set, so
  5466. #                            the suite will be ended if there was a system crash.
  5467. # Examples:        CheckforSystemFailure();
  5468. # Assumptions:    none 
  5469. #                 Called by suiteEnd to insure that if a crash occurred after
  5470. #                  the last TCS that the data in Phoenix will represent what happened.
  5471. #========================================================================
  5472. Calls:    _match(), LogStr(), DefaultCrashHandler()
  5473. Is called by:    SuiteEnd(), TCSEnd()
  5474.  
  5475.  
  5476. Task:    ExitVU()
  5477. Library:    TCS.Lib
  5478. Header:
  5479. #########################################################################
  5480. #                            ExitVU()
  5481. #========================================================================
  5482. # Author:        KTA
  5483. # Description:    This task makes the built in VU task Exit.  The purpose
  5484. #                of defining this as a task is so we can use a task 
  5485. #                reference to this task- gExitVu.  This way we can default 
  5486. #                our Exception Handling task to call the task reference gExitVU 
  5487. #                and thus exit. If others do not want to exit they can redefine 
  5488. #                the task reference to what ever task they prefer.
  5489. # Parameters:    None
  5490. # Returns:        Nothing
  5491. # Examples:        ExitVU(); or to use the task reference  - Call(global gExitVU);
  5492. # Assumptions:    Note: gExitVU is defined in Globals.lib.  If you want to 
  5493. #                override this task reference please do not modify Globals.Lib,
  5494. #                override the it by redefining it in Custom.Lib.
  5495. #########################################################################
  5496. Calls:
  5497. Is called by:    
  5498.  
  5499.  
  5500.  
  5501.  
  5502.  
  5503.  
  5504.  
  5505.  
  5506.  
  5507. ##############################################################
  5508. ##############################################################
  5509. ##############################################################
  5510. Library: Text.Lib
  5511. Calls: "Font.Lib","String.Lib", "ExceptionHandling.Lib";
  5512.  
  5513.  
  5514.  
  5515. Task:    TypeWord(pNumChars := 'Random')
  5516. Library:    Text.Lib
  5517. Header:
  5518. #########################################################################
  5519. #                             TypeWord(pNumChars := 'Random')
  5520. #=======================================================================
  5521. # Author:          KTA 
  5522. # Description:    Will type a string of random characters <pNumChars>
  5523. #                in length.
  5524. # Parameters:    pNumChars - Number of characters in the 'word' default 
  5525. #                            is random length from 1 to 10 characters.
  5526. # Example:        TypeWord();
  5527. #=======================================================================
  5528. Calls:    RandomString(), _Type()
  5529. Is called by:    TypeSentence()
  5530.  
  5531.  
  5532. Task:    TypeSentence(pNumWords := 20)
  5533. Library:    Text.Lib
  5534. Header:
  5535. #########################################################################
  5536. #                             TypeSentence(pNumWords := 20)
  5537. #=======================================================================
  5538. # Author:          KTA 
  5539. # Description:    Will type a sentence of random character strings <pNumWords>
  5540. #                in length. 
  5541. # Parameters:    pNumWords - Number of words in the sentence (default is 20)    
  5542. # Example:        TypeSentence();    
  5543. #=======================================================================
  5544. Calls:    TypeWord(), _Type()
  5545. Is called by:    TypeParagraph()
  5546.  
  5547.  
  5548. Task:    TypeParagraph(pNumSentences := 6,  pObjectNumber := '')
  5549. Library:    Text.Lib
  5550. Header:
  5551. #########################################################################
  5552. #                             TypeParagraph(pNumSentences := 6)
  5553. #=======================================================================
  5554. # Author:          KTA 
  5555. # Description:    Will type a paragraph of sentences of random character strings <pNumSentences>
  5556. #                in length. 
  5557. # Parameters:    pNumSentences - Number of sentences in the paragraph (default is 6)    
  5558. # Example:        TypeParagraph();    
  5559. #=======================================================================
  5560. Calls:    _Type(), SetFontParams(), TypeSentence()
  5561. Is called by:    
  5562.  
  5563.  
  5564.  
  5565.  
  5566.  
  5567.  
  5568.  
  5569.  
  5570.  
  5571. ##############################################################
  5572. ##############################################################
  5573. ##############################################################
  5574. Library: TimingBasics.lib
  5575. Calls:  "Utility.Lib", 'UserInterface.Lib', 'IvyOperations.Lib', 'TCS.Lib',
  5576. "ExceptionHandling.Lib", 'Ivy.vulib';
  5577.  
  5578.  
  5579.  
  5580. Task:    InstallVUTimingMethod()
  5581. Library:    TimingBasics.lib
  5582. Header:
  5583. #########################################################################
  5584. #                         InstallVUTimingMethod()
  5585. #=======================================================================
  5586. # Author:              KTA
  5587. # Description:        Initializes the task references required to complete 
  5588. #                    performance testing utilizing VU.
  5589. # Parameters:        none
  5590. # Returns:            Nothing 
  5591. # Example:            InstallVUTimingMethod();
  5592. # Assumptions        This task must be called prior to doing any performance
  5593. #                    testing with SPEC S&L
  5594. #=======================================================================
  5595. Calls:
  5596. Is called by:    TimeFontTesting()
  5597.  
  5598.  
  5599. Task:    RemoveVUTimingMethod()
  5600. Library:    TimingBasics.lib
  5601. Header:
  5602. #########################################################################
  5603. #                         RemoveVUTimingMethod()
  5604. #=======================================================================
  5605. # Author:              KTA
  5606. # Description:        Removes the the task references required to complete 
  5607. #                    performance testing utilizing VU.
  5608. # Parameters:        none
  5609. # Returns:            Nothing 
  5610. # Example:            RemoveVUTimingMethod();
  5611. # Assumptions        This task can be called after to doing any performance
  5612. #                    testing with SPEC S&L you want to remove any effects of 
  5613. #                    the performance testing.
  5614. #=======================================================================
  5615. Calls:    
  5616. Is called by:    TimeFontTesting()
  5617.  
  5618.  
  5619. Task:    InstallIVTimingMethod()
  5620. Library:    TimingBasics.lib
  5621. Header:
  5622. #########################################################################
  5623. #                         InstallIVTimingMethod()
  5624. #=======================================================================
  5625. # Author:              KTA
  5626. # Description:        Initializes the task references required to complete 
  5627. #                    performance testing utilizing IVY.
  5628. # Parameters:        none
  5629. # Returns:            Nothing 
  5630. # Example:            InstallIVTimingMethod();
  5631. # Assumptions        This task must be called prior to doing any performance
  5632. #                    testing with IVY
  5633. #=======================================================================
  5634. Calls:
  5635. Is called by:    TimeCutPaste(), TimeSaveAs(), TimeOpenFile()
  5636.  
  5637.  
  5638. Task:    RemoveIVTimingMethod()
  5639. Library:    TimingBasics.lib
  5640. Header:
  5641. #########################################################################
  5642. #                         RemoveIVTimingMethod()
  5643. #=======================================================================
  5644. # Author:              KTA
  5645. # Description:        Removes the the task references required to complete 
  5646. #                    performance testing utilizing IVY.
  5647. # Parameters:        none
  5648. # Returns:            Nothing 
  5649. # Example:            RemoveIVTimingMethod();
  5650. # Assumptions        This task can be called after to doing any performance
  5651. #                    testing with IVY and you want to remove any effects of 
  5652. #                    the performance testing.
  5653. #=======================================================================
  5654. Calls:    _Ivy()
  5655. Is called by:    TimeCutPaste(), TimeSaveAs(), TimeOpenFile()
  5656.  
  5657.  
  5658. Task:    StartTimerVU()
  5659. Library:    TimingBasics.lib
  5660. Header:
  5661. #########################################################################
  5662. #                             StartTimerVU
  5663. #=======================================================================
  5664. # Author:              KTA/DM
  5665. # Description:        Begin the Timer with VU
  5666. # Parameters:        none
  5667. # Returns:            none
  5668. # Example:            StartTimerVU();
  5669. #
  5670. #    StartTimer will get called many more times than are actually timed.
  5671. #    Timing will occur only if StopTimer is called and global gTimedEvent is TRUE
  5672. #    gTimedEvent should also be set to the title of the timed test.
  5673. #=======================================================================
  5674. Calls:    Timer(), gStartTimerVUHook
  5675. Is called by:    
  5676.  
  5677.  
  5678. Task:    StopTimerVU(polling := 1, specifier := '', pStopTimerHook := 0)
  5679. Library:    TimingBasics.lib
  5680. Header:
  5681. #########################################################################
  5682. #                     StopTimerVU(polling := 1, specifier := '', pStopTimerHook := 0)
  5683. #=======================================================================
  5684. # Author:              DM/KTA/JH
  5685. # Description:        subtracts the last time saved by StartTimerVU from the current time
  5686. #                    and outputs the event name and the elapsed seconds
  5687. # Parameters:        polling, specifier see Polling()
  5688. #                    pStopTimerHook - name of custom task defined in calling script
  5689. # Returns:            Elapsed time in secs if success, 0 if failure
  5690. # Example:            ETime(time1, time2);
  5691. #=======================================================================
  5692. Calls:    Polling(), Timer(), TimedEventDescription(), pStopTimerHook, gStopTimerVUHook1, 
  5693.         ETime(), LogPerformanceResults(), gStopTimerVUHook2, 
  5694. Is called by:    TimeFontTesting()
  5695.  
  5696.  
  5697. Task:    Polling(PollMethod := 0, specifier := '')
  5698. Library:    TimingBasics.lib
  5699. Header:
  5700. #########################################################################
  5701. #                             Polling(PollMethod, Specifier)
  5702. #=======================================================================
  5703. # Author:              KTA
  5704. # Description:        Polls until target machine is available or until specifier
  5705. #                    is located/gone.
  5706. # Parameters:        polling <> 0    poll before completing
  5707. #                     specifier = ''    match the target when polling
  5708. #                     specifier <> ''    & polling > 0
  5709. #                            poll until the specifier is matched
  5710. #                     specifier <> ''    & polling < 0
  5711. #                            poll until the specifier is not matched
  5712. # Returns:            
  5713. # Example:            Polling(1, {[window t:'Untitled' o:2]});
  5714. #=======================================================================
  5715. Calls:    ExceptionDispatcher(), _matchBoolean(), FindWindow(), 
  5716. Is called by:    StopTimerVU()
  5717.  
  5718.  
  5719. Task:    StartTimerIV()
  5720. Library:    TimingBasics.lib
  5721. Header:
  5722. #########################################################################
  5723. #                         StartTimerIV()
  5724. #=======================================================================
  5725. # Author:              KTA
  5726. # Description:        Calls IVStartWaitForImage() and sets a variable <gStartTimerIV)
  5727. #                     to the current the current time in milliseconds. Note: IVStopWaitForImage()
  5728. #                    is called first in case IVStartWaitForImage() has already been called.
  5729. # Parameters:        None
  5730. # Returns:            Nothing - but sets gStartTimerIV to the currenttime in Milliseconds
  5731. # Example:            StartTimerIV();
  5732. # Assumptions        Ivy exists on the target machine and has been initialized.
  5733. #=======================================================================
  5734. Calls:    _Ivy(), gStartTimerIVHook
  5735. Is called by:    PerformScroll()
  5736.  
  5737.  
  5738. Task:    StopTimerIV(pWaitTime := 10, pStopTimerHook := 0)
  5739. Library:    TimingBasics.lib
  5740. Header:
  5741. #########################################################################
  5742. #                         StopTimerIV()
  5743. #=======================================================================
  5744. # Author:              KTA
  5745. # Description:        Calls IVGetTimeFound() and sets a variable <endTime>
  5746. #                     to the current the current time in milliseconds. It then 
  5747. #                    calls IVSubtractTimes() to get the difference between global
  5748. #                    <gStartTimerIV> and <endTime>.  Then the IV and appleEvent overhead
  5749. #                    is subtracted.
  5750. # Parameters:        pWaitTime - Time to wait this can be longer than it takes the image to 
  5751. #                                appear, but must not be shorter.
  5752. #                    pStopTimerHook - name of custom task defined in calling script
  5753. #                                
  5754. # Returns:            NetTime2 - success, difference between gStartTimerIV and Endtime with overhead
  5755. #                                subtracted.
  5756. #                    0 - failure
  5757. # Example:            StopTimerIV();
  5758. # Assumptions        Ivy exists on the target machine and has been initailized.
  5759. #                    Also requires that a call to StartTimerIV() was made prior to
  5760. #                    calling this routine.
  5761. #=======================================================================
  5762. Calls:    IVGetTimeFound(), _Ivy(), TimedEventDescription(), pStopTimerHook, 
  5763.         gStopTimerIVHook1, FormatMilliSeconds(), LogPerformanceResults(), 
  5764.         gStopTimerIVHook2
  5765. Is called by:    TimeCutPaste(), PerformScroll()
  5766.  
  5767.  
  5768. Task:    LocateTheString( pTheRect, theString := "Stop", theFont := "Geneva", 
  5769.         theSize := 12, theStyle := 0  )
  5770. Library:    TimingBasics.lib
  5771. Header:
  5772. #########################################################################
  5773. #     LocateTheString( pTheRect, theString, theFont, theSize, theStyle  )
  5774. #=======================================================================
  5775. # Author:              KTA
  5776. # Description:        Makes a call to IVLocateString() to locate a string with the attributes
  5777. #                    of the parameters and returns the rect of the found string.
  5778. # Parameters:        pTheRect - the rect to begin looking for the string in.
  5779. #                    theString - the actual text of the string to look for.
  5780. #                    theFont - the font title of theString.
  5781. #                    theSize - the size of theString.
  5782. #                    theStyle - the style of theSting.
  5783. # Returns:            the rect of theString that was found on target machine.
  5784. # Example:            LocateTheString({0,0,480, 640}, 'Hello World', 'Times', 10, 0);
  5785. # Assumptions        Ivy exists on the target machine and has been initialized.
  5786. #=======================================================================
  5787. Calls:    _Ivy()
  5788. Is called by:    TimeCutPaste(), TimeScrolling()
  5789.  
  5790.  
  5791. Task:    FormatMilliSeconds(pTimeInMilliseconds := '')
  5792. Library:    TimingBasics.lib
  5793. Header:
  5794. #########################################################################
  5795. #                 FormatMilliSeconds( pTimeInMilliseconds )
  5796. #=======================================================================
  5797. # Author:              KTA
  5798. # Description:        Formats a time value in milliseconds by adding a decimal
  5799. #                    point to seperate the integer portion from the fractional
  5800. #                    portion.
  5801. # Parameters:        pTimeInMilliseconds - a string or integer which is a time 
  5802. #                            value in milliseconds.
  5803. # Returns:            String - Formated value.
  5804. # Example:            x := FormatMilliSeconds('76543');
  5805. #=======================================================================
  5806. Calls:    NumToStr(), 
  5807. Is called by:    StopTimerIV()
  5808.  
  5809.  
  5810. Task:    LogPerformanceResults(pResultCode := '', pErrStr := '', pTCSVal := 0, 
  5811. pTCSStr := '', pCommentStr := '', pExceptionFlag := '')
  5812. Library:    TimingBasics.lib
  5813. Header:
  5814. #########################################################################
  5815. #             LogPerformanceResults() 
  5816. #========================================================================
  5817. #
  5818. # Author:        ML
  5819. # Description:    Wrapper task for logging a performance result
  5820. # Parameters:    pResultCode, pErrStr, pTCSVal, pTCSStr, pCommentStr, pExceptionFlag
  5821. #                - see TCSEnd()
  5822. # Returns:        none
  5823. # Examples:        LogPerformanceResults()
  5824. #========================================================================
  5825. Calls:    TCSStart(), TCSEnd(), 
  5826. Is called by:    StopTimerVU(), StopTimerIV()
  5827.  
  5828.  
  5829. Task:    TimedEventDescription()
  5830. Library:    TimingBasics.lib
  5831. Header:
  5832. #########################################################################
  5833. #             
  5834. #                TimedEventDescription() 
  5835. #========================================================================
  5836. #
  5837. # Author:        ML
  5838. # Description:    Text description of timed event from gTimedEvent
  5839. # Parameters:    none
  5840. # Returns:        Text description of timed event
  5841. # Examples:        TimedEventDescription()
  5842. #========================================================================
  5843. Calls:    
  5844. Is called by:    StopTimerVU(), StopTimerIV()
  5845.  
  5846.  
  5847.  
  5848.  
  5849.  
  5850.  
  5851.  
  5852.  
  5853.  
  5854. ##############################################################
  5855. ##############################################################
  5856. ##############################################################
  5857. Library: TimingOperations.lib
  5858. Calls: "UserInterface.lib", "Font.Lib", "Ivy.vulib", "TimingBasics.Lib",
  5859. "StandardFile.Lib", "WorldReady.Lib", "Output.Lib", "ExceptionHandling.Lib",
  5860. "IvyOperations.Lib";
  5861.  
  5862.  
  5863. Task:    GetProcessListIconRect()
  5864. Library:    TimingOperations.lib
  5865. Header:
  5866. #########################################################################
  5867. #                         GetProcessListIconRect()
  5868. #=======================================================================
  5869. # Author:              KTA
  5870. # Description:        Returns the rect of the application icon for the process list menu.
  5871. # Parameters:        none
  5872. # Returns:            Returns the rect of the application icon for the process list menu.
  5873. # Example:            GetProcessListIconRect();
  5874. # Assumptions        Processlist is the farthest menu to the right.
  5875. #=======================================================================
  5876. Calls:    ExceptionDispatcher(), 
  5877. Is called by:    
  5878.  
  5879.  
  5880. Task:    GetAppleMenuIconRect()
  5881. Library:    TimingOperations.lib
  5882. Header:
  5883. #########################################################################
  5884. #                         GetAppleMenuIconRect()
  5885. #=======================================================================
  5886. # Author:              KTA
  5887. # Description:        Returns the rect of the Apple icon for the Apple menu.
  5888. # Parameters:        none
  5889. # Returns:            Returns the rect of the Apple icon for the Apple menu.
  5890. # Example:            GetAppleMenuIconRect();
  5891. # Assumptions        Apple menu is the farthest menu to the left.
  5892. #=======================================================================
  5893. Calls:    ExceptionDispatcher()
  5894. Is called by:    
  5895.  
  5896.  
  5897. Task:    GetFirstTwoMenusRect()
  5898. Library:    TimingOperations.lib
  5899. Header:
  5900. #########################################################################
  5901. #                         GetFirstTwoMenusRect()
  5902. #=======================================================================
  5903. # Author:              KTA
  5904. # Description:        Returns the rect of the Apple menu and the file menu
  5905. # Parameters:        none
  5906. # Returns:            Returns the rect of the Apple menu and the file menu.
  5907. # Example:            GetFirstTwoMenusRect();
  5908. # Assumptions        .
  5909. #=======================================================================
  5910. Calls:    ExceptionDispatcher()
  5911. Is called by:    TimeSaveAs(), TimeOpenFile()
  5912.  
  5913.  
  5914. Task:    TimeCutPaste(pNumTimes := 1)
  5915. Library:    TimingOperations.lib
  5916. Header:
  5917. #########################################################################
  5918. #                         TimeCutPaste()
  5919. #=======================================================================
  5920. # Author:              KTA
  5921. # Description:        Will cut and paste the entire contents of a document and time how long
  5922. #                    the operations take.
  5923. # Parameters:        pNumTimes - number of times to time the operation.
  5924. # Returns:            nothing
  5925. # Example:            TimeCutPaste();
  5926. # Assumptions :     Requires 'STOP' tag at bottom of document in Geneva, 12 point, plain
  5927. #                    Also requires :
  5928. #                        keyEq('a') will select all
  5929. #                        keyEq('x') will cut
  5930. #                        keyEq('v') will paste
  5931. #                        and that pasting will display the end of the document 
  5932. #                        (where 'Stop' should exist).
  5933. #=======================================================================
  5934. Calls:    InitIvy(), KeyEq(), DialogCheck(), LogStr(), ExceptionDispatcher(), 
  5935.         LocateTheString(), _Ivy(), InstallIVTimingMethod(), StopTimerIV(), 
  5936.         RemoveIVTimingMethod(), QuitIvy()
  5937. Is called by:    
  5938.  
  5939.  
  5940. Task:    TimeSaveAs(pFileName := '',pSaveMI := {8,2})
  5941. Library:    TimingOperations.lib
  5942. Header:
  5943. #########################################################################
  5944. #                         TimeSaveAs(pFileName, pSaveMI)
  5945. #=======================================================================
  5946. # Author:              KTA
  5947. # Description:        Sets up the requirements for timing utilizing IVY and times
  5948. #                    how long it takes an application to save a file. Then removes
  5949. #                    the all global varibles that are defined in order to do timing.
  5950. # Parameters:        pFileName - FileName for the document you want to save.
  5951. #                    pSaveMI - 'Save As…' menuitem descriptor (ordinality contained in a list)
  5952. # Returns:            Nothing
  5953. # Example:            TimeSaveAs('@TestDoc', {7,2});
  5954. # Assumptions        Processlist is the farthest menu to the right.
  5955. #=======================================================================
  5956. Calls:    InitIvy(), GetFirstTwoMenusRect(), _Ivy(), InstallIVTimingMethod(), 
  5957.         SwitchScriptToUS(), SaveAs(), SwitchScriptBackToOrig(), RemoveIVTimingMethod(), 
  5958.         QuitIvy()
  5959. Is called by:    
  5960.  
  5961.  
  5962. Task:    TimeOpenFile(pFileName := '', pOpenMI := {2,2})
  5963. Library:    TimingOperations.lib
  5964. Header:
  5965. #########################################################################
  5966. #                         TimeOpenFile(pFileName, pOpenMI)
  5967. #=======================================================================
  5968. # Author:              KTA
  5969. # Description:        Sets up the requirements for timing utilizing IVY and times
  5970. #                    how long it takes an application to open a file. Then removes
  5971. #                    the all global varibles that are defined in order to do timing.
  5972. # Parameters:        pFileName - FileName for the document you want to save.
  5973. #                    pOpenMI - 'Open' menuitem descriptor (ordinality contained in a list)
  5974. # Returns:            Nothing
  5975. # Example:            TimeOpenFile('@TestDoc', {2,2});
  5976. # Assumptions        Processlist is the farthest menu to the right.
  5977. #=======================================================================
  5978. Calls:    InitIvy(), GetFirstTwoMenusRect(), _Ivy(), SwitchScriptToUS(), 
  5979.         InstallIVTimingMethod(), openFile(), SwitchScriptBackToOrig(), 
  5980.         RemoveIVTimingMethod(), QuitIvy()
  5981. Is called by:    
  5982.  
  5983.  
  5984. Task:    TimeFontTesting(numTimes := 1, pFontRecord := {})
  5985. Library:    TimingOperations.lib
  5986. Header:
  5987. #########################################################################
  5988. #                    TimeFontTesting(numTimes, pFontRecord)    
  5989. #========================================================================
  5990. # Author:        KTA
  5991. # Description:    Times the selection of Fonts, Sizes and Styles.  Normally this 
  5992. #                task will be called after all text has been selected.
  5993. # Parameters:    numTimes - number of times to perform the timed tests.
  5994. #                pFontRecord - (optional) makes it possible to pass in a 
  5995. #                            fontRecord to define which fonts, sizes and styles 
  5996. #                            will be selected and therefore timed.  FontRecords 
  5997. #                            take the following form: 
  5998. #                            {'FontName', 'SizeName',{'StyleName1', 'StyleName2', etc}}
  5999. # Returns:        nothing
  6000. # Example:        TimeFontTesting(4, {'Times', '12',{'Bold', 'Italics'}});
  6001. #                 TimeFontTesting(2, );
  6002. # Assuptions: a                 
  6003. #========================================================================
  6004. Calls:    InstallVUTimingMethod(), RandomFontRecords(), FindMenu(), SelectmenuItem(), 
  6005.         StopTimerVU(), RemoveVUTimingMethod()
  6006. Is called by:    
  6007.  
  6008.  
  6009. Task:    SetUpDocumentWindow(pWindowTitle,pTopScreenLocation := {0,20})
  6010. Library:    TimingOperations.lib
  6011. Header:
  6012. #########################################################################
  6013. #                     SetUpDocumentWindow()
  6014. #========================================================================
  6015. # Author:        MDS
  6016. # Description:    Positions the title bar of a document at location {0,20}
  6017. #                and resizes the document to aconstant size.
  6018. #                (according to the main screen size)            
  6019. # Assumtions:    the document window is the top window (ordinality: 1)
  6020. # Parameters:    pWindowTitle - Title of the docuemnt to resize
  6021. # Returns:        nothing
  6022. # Example:        
  6023. #========================================================================
  6024. Calls:    ExceptionDispatcher(), findWindow(), DragWindow(), SizeWindow()
  6025. Is called by:    TimeScrolling()
  6026.  
  6027.  
  6028. Task:    PerformScroll( pDocumentName, pEndPointRect, pWhichDirection, pWaitForScroll, 
  6029.         pScrollByLine, pScrollCoords)
  6030. Library:    TimingOperations.lib
  6031. Header:
  6032. #########################################################################
  6033. #         PerformScroll( pEndPointRect, pWhichDirection := 1)
  6034. #========================================================================
  6035. # Author:        MDS
  6036. # Description:    Uses Ivy to time how long it takes to scroll a document from
  6037. #                top to bottom or viceversa
  6038. # Parameters:    pDocumentName - name of the document in which to time scrolling
  6039. #                pEndPointRect - list with the points of the rectangle containing
  6040. #                                an image of the end point string
  6041. #                pWhichDirection - in which direction to time scrolling:
  6042. #                                    0 - Up, 1 - Down
  6043. #                pWaitForScroll - Time to wait with scroll arrow held down Note:
  6044. #                                this should be longer than the scroll should take
  6045. #                                so IVY has time to locate the image.
  6046. #                pScrollByLine - whether to scroll line by line or screen by screen
  6047. #                                1 - line by line
  6048. #                                0 - screen by screen
  6049. #                pScrollCoords - 2 element list of coordinates of scroll point
  6050. # Returns:        The actual time that takes to scroll    
  6051. # Example:        
  6052. # Assumptions:    1- The document contains a string which indicates the end point
  6053. #                2- The string should be created with at least one space at the
  6054. #                    begining and one space at the end, otherwise the cursur beam
  6055. #                    will prevent Ivy from locating the end point string.
  6056. #
  6057. #========================================================================
  6058. Calls:    gScrollWindow, ScrollWindow(), logstr(), _move(), StartTimerIV(), 
  6059.         _pressMouse(), _releasemouse(), StopTimerIV()
  6060. Is called by:    TimeScrolling()
  6061.  
  6062.  
  6063. Task:    TimeScrolling( pDocumentName := "", pIterations := 1, pWhichDirection  := 1,
  6064. pWaitForScroll := 35, pHowEndScroll := "Stop", pScrollByLine :=1)
  6065. Library:    TimingOperations.lib
  6066. Header:
  6067. #########################################################################
  6068. #         TimeScrolling( pDocumentName, pIterations, pWhichDirection )
  6069. #========================================================================
  6070. # Author:        MDS
  6071. # Description:    Times the scrolling of a document
  6072. # Parameters:    pDocumentName - name of the document in which to time scrolling
  6073. #                pIterations -     how many iterations to time scrolling
  6074. #                pWhichDirection - in which direction to time scrolling:
  6075. #                                    0 - Up, 1 - Down
  6076. #                pWaitForScroll - Time to wait with scroll arrow held down Note:
  6077. #                                this should be longer than the scroll should take
  6078. #                                so IVY has time to locate the image.
  6079. #                pHowEndScroll - How IVY will know when the scroll is complete
  6080. #                                {string} - scroll is complete when {string} appears
  6081. #                                - must be formatted in 12 point Geneva!
  6082. #                                1 - scroll is complete when thumbnail is at bottom of
  6083. #                                scroll bar
  6084. #                pScrollByLine - whether to scroll line by line or screen by screen
  6085. #                                1 - line by line
  6086. #                                0 - screen by screen
  6087. # Returns:        The actual time that takes to scroll    
  6088. # Example:        
  6089. #========================================================================
  6090. Calls:    SetUpDocumentWindow(), InitIvy(), gScrollWindow, ScrollWindow(), 
  6091.         ExceptionDispatcher(), logstr(), LocateTheString(), _Ivy(), PerformScroll(), 
  6092.         QuitIvy()
  6093. Is called by:    
  6094.  
  6095.  
  6096.  
  6097.  
  6098.  
  6099.  
  6100.  
  6101.  
  6102.  
  6103. ##############################################################
  6104. ##############################################################
  6105. ##############################################################
  6106. Library: UserInterface.lib
  6107. Calls: "Geometry.lib","String.Lib","Output.lib","TCS.lib", 
  6108.         "StandardFile.lib", "ExceptionHandling.Lib";
  6109.  
  6110.  
  6111.  
  6112. Task:    SelectMenuItem(pMenu1, pMenu2 := "", pMenu3 := "")
  6113. Library:    UserInterface.lib
  6114. Header:
  6115. ########################################################################
  6116. #                 SelectMenuItem(pMenu1, pMenu2, pMenu3)                    
  6117. #=======================================================================
  6118. # Author:           KTA
  6119. # Description:        Selects the menu item by its title or ordinality.
  6120. #                    All parameters are expected to be the same type.
  6121. # Parameters:        pMenu1 := Menu item to be selected.
  6122. #                    pMenu2 := Menu name if non-hier menu and
  6123. #                                 Level 2 menu item if hier menu.
  6124. #                    pMenu3 := "" if non-hier menu.
  6125. #                                 Menu name if hier menu.
  6126. # Returns:            menuTitle - MenuItem name that selection was successful
  6127. #                    0 - Couldn't select menu item
  6128. # Notes:            It is not mandatory to specify input parameters 'pMenu2' 
  6129. #                    or 'pMenu3'.  In that case, default value, "",
  6130. #                    will be used.
  6131. #=======================================================================
  6132. Calls:    _matchBoolean(), _match(), LogStr(), gPreSelectMenuItemHook, 
  6133.         _select(), gPostSelectMenuItemHook, DialogCheck()
  6134. Is called by:    Scrapbook(), DoSetUpApp(), SetLineMenuItems(), 
  6135.                 HelpBalloons(), SetFont(), SetStyle(), SetSize(), 
  6136.                 Quit(), LaunchByAppleMenu(), AboutBox(), PrintSample(), 
  6137.                 PageSetup(), Printer(), SelectAll(), SaveAs(), OpenFile(), 
  6138.                 Revert(), CancelStandardFile(), Save(), TimeFontTesting(), 
  6139.                 CloseWindow(), DoWPTools(), TypeTradChineseString()
  6140.  
  6141.  
  6142. Task:    SelectPopUpMenuItem(pPopUpMenuItemSpecifer, pPopupMenuSpecifier)
  6143. Library:    UserInterface.lib
  6144. Header:
  6145. ########################################################################
  6146. #                 SelectPopUpMenuItem(pPopUpMenuItemSpecifer, pPopupMenuSpecifier)                    
  6147. #=======================================================================
  6148. # Author:           KTA
  6149. # Description:        Selects the popUp menu item <pPopUpMenuItemSpecifer>
  6150. #                    contained in the popUp menu <pPopupMenuSpecifier>.
  6151. #                    Parameter types can be mixed.
  6152. # Parameters:        pPopUpMenuItemSpecifer := PopUp menu item to be selected.
  6153. #                                        Can be string, integer, descriptor
  6154. #                    pPopupMenuSpecifier := PopUp menu which contains <pPopUpMenuItemSpecifer>.
  6155. #                                        Can be string, integer, descriptor
  6156. # Returns:            1 - successful
  6157. #                    0 - Couldn't select menu item
  6158. # Notes:            Only works with Popup menuitems that VU recognizes.
  6159. #=======================================================================
  6160. Calls:    _match(), _select(), LogStr()
  6161. Is called by:    
  6162.  
  6163.  
  6164. Task:    FindMenu(pTheMenuItem)
  6165. Library:    UserInterface.lib
  6166. Header:
  6167. #########################################################################
  6168. #                             FindMenu(pTheMenuItem)
  6169. #=======================================================================
  6170. # Author:              KTA
  6171. # Description:        Returns the Menu(s) in which <pTheMenuItem> is contained.
  6172. # Parameters:        pTheMenuItem    :=    Title of the menuitem to be searched for.
  6173. # Returns:            0    -    Can't match <pTheMenuItem>.
  6174. #                    {theMenu,""}    -    for a nonHierarchical menu.
  6175. #                    {theHMenuItem, theMenu}    -    if its hierarchical.
  6176. # Example:            MyMenu := FindMenu('Paste');
  6177. #=======================================================================
  6178. Calls:    _match(), ExceptionDispatcher(), 
  6179. Is called by:    SetFont(), SetStyle(), SetSize(), TimeFontTesting()
  6180.  
  6181.  
  6182. Task:    KeyEq(pKeyEquiv, pOtherkey := 0, pNumTimes := 1) 
  6183. Library:    UserInterface.lib
  6184. Header:
  6185. #########################################################################
  6186. #                            KeyEq(pKeyEquiv,pOtherkey, pNumTimes)
  6187. #========================================================================
  6188. # Author:        KTA
  6189. # Description:    This routine will select the Keyboard Equiv <pKeyEquiv>
  6190. # Parameters:    pKeyEquiv -    string holding character to be typed with
  6191. #                            command key down.
  6192. #                pOtherkey -    integer -  representing special keys to hold 
  6193. #                            down in conjunction with the command key
  6194. #                    1 - Shift key
  6195. #                    2 - Option key
  6196. #                    3 - Control key
  6197. #                pNumTimes -    integer - representing number of times to type keyEq.
  6198. # Returns:        None
  6199. # Examples:        KeyEq("q");
  6200. #========================================================================
  6201. Calls:    LogStr(), _pressKey(), gPreKeyEqHook, _type(), _releaseKey
  6202. Is called by:    Scrapbook(), FinderNavigate(), Quit(), LaunchByTypeSelect(), 
  6203.                 VerifyAppPriorToLaunch(), OpenFile(), CancelStandardFile(), 
  6204.                 Save(), ApplicationVerification(), TimeCutPaste(), 
  6205.                 CloseWindow(), DialogDismisser(), DismissDialog(), 
  6206.                 SwitchScript()
  6207.  
  6208.  
  6209. Task:    TestWindow(pSpecifier := 0, pFunctionList := 0, pRestoreWindow := 0, 
  6210.         pNumTimes := 1, pDragXY := {0,20}) 
  6211. Library:    UserInterface.lib
  6212. Header:
  6213. #########################################################################
  6214. #     TestWindow(pSpecifier,pFunctionList,pRestoreWindow,pNumTimes,pDragXY)
  6215. #=======================================================================
  6216. # Author:         NJV
  6217. #
  6218. # Description:    Performs the specified functions as defined in the input
  6219. #                parameter pFunctionList.  If pFunctionList is not passed,
  6220. #                or is passed as 0, then the following operations are
  6221. #                performed on the window specified by input parameter
  6222. #                pSpecifier.  The default behavior will perform the
  6223. #                following behaviors on the frontmost window* (see *NOTE).
  6224. #                Listed below is the list of function numbers and a brief
  6225. #                description of what that particular function does:
  6226. #
  6227. #                    #0    Complete Window Test
  6228. #                            Performs functions 1 through 17
  6229. #                            (17 is done twice - zoom & zoom back)
  6230. #                    #1    Resize to random width and height.
  6231. #                    #2    Attempt resize to 20,20 (should not allow it)
  6232. #                    #3    Scroll the vertical scroll bar to random location.
  6233. #                    #4    Scroll the vertical scroll bar to end location.
  6234. #                    #5    Scroll the vertical scroll bar to beginning location.
  6235. #                    #6    Scroll the vertical scroll bar to original location.
  6236. #                    #7    Scroll the horizontal scroll bar to random location.
  6237. #                    #8    Scroll the horizontal scroll bar to end location.
  6238. #                    #9    Scroll the horizontal scroll bar to beginning location.
  6239. #                    #10    Scroll the horizontal scroll bar to original location.
  6240. #                    #11    Resize window to largest possible and then
  6241. #                    #12    Resize back to smallest window size
  6242. #                    #13 Size window across screen border to second screen
  6243. #                        (if 2 screens) and back
  6244. #                    #14    Drag window across screen border and back
  6245. #                    #15    Drag random location and back to original location
  6246. #                    #16    Drag window back to original location.
  6247. #                    #17    Zoom.
  6248. #                    #18 Complete Window Size Test
  6249. #                            Performs functions 1,2,11,12, and 13
  6250. #                    #19 Complete Window Scroll Test
  6251. #                            Performs functions 3,4,5,6,7,8,9, and 10
  6252. #                    #20 Complete Window Drag Test
  6253. #                            Performs functions 14,15, and 16
  6254. #                    #21 Complete Window Zoom Test
  6255. #                            Performs function 17 twice (zoom - zoom back)
  6256. #                    #22 A More Complete Window Scroll Test
  6257. #                            Performs functions 2,3,4,5,6,7,8,9, and 10.
  6258. #                            This is the same as #19 except it sizes the
  6259. #                            window to the smallest possible size.  This
  6260. #                            is better in that it is more likely for the
  6261. #                            scrollbars to be active.
  6262. #                    #23 A More Complete Window Drag Test
  6263. #                            Performs functions 2,14,15, and 16
  6264. #                            This is the same as #20 except it sizes the
  6265. #                            window to the smallest possible size.  This
  6266. #                            is better in that it is more likely for the
  6267. #                            window to be able to be dragged across screen
  6268. #                            boundaries.
  6269. #        
  6270. # Parameters: pSpecifier -  Title or Ordinality or partial window descriptor
  6271. #                            of window to be tested
  6272. #                            If this parameter is not passed, default
  6273. #                            behavior of Tasks will be used (generally the
  6274. #                            frontmost window - see *NOTE below)
  6275. #
  6276. #            pFunctionList - A list containing the functions to be
  6277. #                            executed and the number of times to exercize
  6278. #                            each function.  The functions will be executed
  6279. #                            in the order that they are defined.  The default
  6280. #                            is to execute all tests once. The pFunctionList
  6281. #                            parameter can have the following formats:
  6282. #                            
  6283. #                            integer:
  6284. #                                    Number of a single test to run once.
  6285. #                                    Functions are numbered above.
  6286. #                                    0 to execute full sequence once.
  6287. #
  6288. #                            list of integers:
  6289. #                                    A list of test numbers to run -
  6290. #                                    each test will be run once and
  6291. #                                    in the same order that they appear
  6292. #                                    in the list.
  6293. #
  6294. #                            list of lists:
  6295. #                                    A list of {test#,#times} lists
  6296. #                                    where test# is the number of the
  6297. #                                    test and #times is the number of
  6298. #                                    times to execute that test.  Each
  6299. #                                    list will be processed in order.
  6300. #                                    If an item in the main list is an
  6301. #                                    integer and not a list, that test
  6302. #                                    number will be executed once.
  6303. #
  6304. #                pRestoreWindow -    1 to restore window to original size,
  6305. #                                    location, and scrollbar status.
  6306. #                                0 not to restore window
  6307. #
  6308. #                pNumTimes -    integer for number of times to execute test
  6309. #
  6310. #                pDragXY -    Upper Left-Top corner to drag window to
  6311. #
  6312. # Returns:        0 - Couldn't find specified window
  6313. #                1 - Executed OK
  6314. #
  6315. # Assumptions:    None
  6316. #
  6317. #========================================================================
  6318. Calls:    FindWindow(), SelectWindow(), _matchBoolean(), _collect(), LogStr(), 
  6319.         DragWindow(), resetWindowFunctionList(), WindowFunction(), ResetWindow()
  6320. Is called by:    DoWindow()
  6321.  
  6322.  
  6323. Task:    WindowFunction(pSpecifier, pTheFunction, pDragXY, pDestinationPoint)
  6324. Library:    UserInterface.lib
  6325. Header:
  6326. #########################################################################
  6327. #         WindowFunction(pSpecifier, pTheFunction, pDragXY,pDestinationPoint)
  6328. #=======================================================================
  6329. # Author:         NJV
  6330. # Description:    Performs the specified function defined in the input
  6331. #                parameter pTheFunction to the window specified by pSpecifier.
  6332. #                Listed below is the list of function numbers and a brief
  6333. #                description of what that particular function does:
  6334. #
  6335. #                    #1    Resize to random width and height.
  6336. #                    #2    Attempt resize to 20,20 (should not allow it)
  6337. #                    #3    Scroll the vertical scroll bar to random location.
  6338. #                    #4    Scroll the vertical scroll bar to end location.
  6339. #                    #5    Scroll the vertical scroll bar to beginning location.
  6340. #                    #6    Scroll the vertical scroll bar to original location.
  6341. #                    #7    Scroll the horizontal scroll bar to random location.
  6342. #                    #8    Scroll the horizontal scroll bar to end location.
  6343. #                    #9    Scroll the horizontal scroll bar to beginning location.
  6344. #                    #10    Scroll the horizontal scroll bar to original location.
  6345. #                    #11    Resize window to largest possible
  6346. #                    #12    Resize back to smallest window size
  6347. #                    #13 Size window across screen border to second screen
  6348. #                        (if 2 screens) and back
  6349. #                    #14    Drag window across screen border and back
  6350. #                    #15    Drag window to random location.
  6351. #                    #16    Drag window to location specified by pDestinationPoint.
  6352. #                    #17    Zoom.
  6353. #                    #18 Complete Window Size Test
  6354. #                            Performs functions 1,2,11,12, and 13
  6355. #                    #19 Complete Window Scroll Test
  6356. #                            Performs functions 3,4,5,6,7,8,9, and 10
  6357. #                    #20 Complete Window Drag Test
  6358. #                            Performs functions 14,15, and 16
  6359. #                    #21 Complete Window Zoom Test
  6360. #                            Performs function 17 twice (zoom - zoom back)
  6361. #                    #22 A More Complete Window Scroll Test
  6362. #                            Performs functions 2,3,4,5,6,7,8,9, and 10
  6363. #                            This is the same as #19 except it sizes the
  6364. #                            window to the smallest possible size.  This
  6365. #                            is better in that it is more likely for the
  6366. #                            scrollbars to be active.
  6367. #                    #23 A More Complete Window Drag Test
  6368. #                            Performs functions 2,14,15, and 16
  6369. #                            This is the same as #20 except it sizes the
  6370. #                            window to the smallest possible size.  This
  6371. #                            is better in that it is more likely for the
  6372. #                            window to be able to be dragged across screen
  6373. #                            boundaries.
  6374. #
  6375. # Parameters:    pSpecifier -    Title of window to be tested
  6376. #
  6377. #                pTheFunction -    The number of the test to run
  6378. #
  6379. #                pDragXY -    Left-Top point (list of {left,top}) to drag
  6380. #                            window to. (used if pTheFunction = 13 or 14)
  6381. #    
  6382. #                pDestinationPoint -    Left/Top point (list of {left,top}) of
  6383. #                                    original window (used if pTheFunction = 16)
  6384. #
  6385. # Returns:        0 - Couldn't perform specified Task
  6386. #                1 - Executed OK
  6387. #
  6388. # Assumptions:    None.
  6389. #
  6390. # *NOTE:        The TestWindow() function provides much more versatility
  6391. #                than this routine.  WindowFunction is called by TestWindow.
  6392. #========================================================================
  6393. Calls:    LogStr(), resetWindowFunctionList(), WindowFunction(), SizeWindow(), 
  6394.         GetVHScrollBars(), ScrollWindow(), FindWindow(), ExceptionDispatcher(), 
  6395.         SizeAcrossScreens(), DragWindow(), ZoomWindow()
  6396. Is called by:    TestWindow(), WindowFunction()
  6397.  
  6398.  
  6399. Task:    ResetWindowFunctionList(pFunctionList)
  6400. Library:    UserInterface.lib
  6401. Header:
  6402. #########################################################################
  6403. #                ResetWindowFunctionList(pFunctionList)
  6404. #========================================================================
  6405. # Author:        KTA    
  6406. # Description:    This routine takes a window functionlist as a parameter and removes
  6407. #                any test which are specified as not available by the gDoWindowList global.
  6408. # Parameters:    pFunctionList - Initial function list
  6409. #                global gDoWindowList := {1,1,1,1};
  6410. #                 Set each element to 1 or 0.  Flag for performing DoWindows tests as follows:
  6411. #                 Element:      1 - Sizing
  6412. #                             2 - Scrolling
  6413. #                              3 - Dragging
  6414. #                             4 - Zooming
  6415. # Returns:        Functiuon list after remove tests that aren't supported.
  6416. # Examples:        FunctionList := ResetWindowFunctionList({1,2,11,12,16,17});
  6417. #========================================================================
  6418. Calls:    
  6419. Is called by:    TestWindow(), WindowFunction()
  6420.  
  6421.  
  6422. Task:    DragAcrossScreens(pSpecifier,pDragXY)
  6423. Library:    UserInterface.lib
  6424. Header:
  6425. #########################################################################
  6426. #                    DragAcrossScreens(pSpecifier,pDragXY)
  6427. #========================================================================
  6428. # Author:            NJV
  6429. # Description:        If there are two screens present, this task will drag
  6430. #                    the window specified by <pSpecifier> so that half of the
  6431. #                    window is on the first screen and half of the window
  6432. #                    is on the second screen.  
  6433. # Parameters:        pSpecifier - title of window to drag
  6434. #                    pDragXY - a list of two co-ordinates (left-top) pixel
  6435. #                            to drag window to (i.e.{0,20} to avoid menu bar
  6436. #                            on main screen).
  6437. # Returns:            1 - successful
  6438. #                    0 - unsuccessful
  6439. # Examples:            DragAcrossScreens("Untitled",{0,20}).
  6440. # Assumptions:        None
  6441. #========================================================================
  6442. Calls:    _match(), _MatchBoolean(), FindWindow(), TCSStart(), LogStr(), 
  6443.         TCSEnd()
  6444. Is called by:    WindowFunction()
  6445.  
  6446.  
  6447. Task:    SizeAcrossScreens(pSpecifier, pDragXY) 
  6448. Library:    UserInterface.lib
  6449. Header:
  6450. #########################################################################
  6451. #                SizeAcrossScreens(pSpecifier,pDragXY)
  6452. #========================================================================
  6453. # Author:            NJV
  6454. # Description:        If there are two screens present, this task will size
  6455. #                    the window specified by <pSpecifier>  (if there's a grow box)
  6456. #                    so half of the window is on the first screen and half of
  6457. #                    the window is on the second screen.  
  6458. # Parameters:        pSpecifier - Descriptor of the window to size.
  6459. #                    pDragXY - a list of two co-ordinates (left-top) pixel
  6460. #                            to drag window to (i.e.{0,20} to avoid menu bar
  6461. #                            on main screen).
  6462. # Returns:            1 - successful
  6463. #                    0 - unsuccessful
  6464. # Examples:            SizeAcrossScreens("myWindow",{0,20}).
  6465. # Assumptions:        None
  6466. #========================================================================
  6467. Calls:    _match(), _MatchBoolean(), FindWindow(), TCSStart(), SizeWindow(), 
  6468.         LogStr(), ResetWindow(), DragWindow(), TCSEnd()
  6469. Is called by:    WindowFunction()
  6470.  
  6471.  
  6472. Task:    AdjustRectToScreen(pTheRect)
  6473. Library:    UserInterface.lib
  6474. Header:
  6475. #########################################################################
  6476. #                        AdjustRectToScreen(pTheRect)
  6477. #========================================================================
  6478. # Author:            NJV
  6479. # Description:        This routine checks a rectangle to see if it is within
  6480. #                    the screen, if any part of it is not, it will be 
  6481. #                    clipped so as to fit the screen.  This is done by
  6482. #                    comparing the coordinates of the rectangle with that of 
  6483. #                    the screen.  
  6484. # Parameters:        pTheRect - holds the coordinates of the rectangle.
  6485. # Returns:            pTheRect -     the coordinates of the clipped rectangle.
  6486. #                                (if it was not completely within the screen)
  6487. #                            or    the coordinates of the original rectangle
  6488. #                                (if it lies totally within the screen)
  6489. # Examples:            AdjustRectToScreen(Window.r).
  6490. # Assumptions:        All windows are no larger than the screen.
  6491. #========================================================================
  6492. Calls:    _collect(), 
  6493. Is called by:    CoverCompletely()
  6494.  
  6495.  
  6496. Task:    CoverCompletely (pFirstWindow, pSecondWindow)
  6497. Library:    UserInterface.lib
  6498. Header:
  6499. #########################################################################
  6500. #                        CoverCompletely(pFirstWindow,pSecondWindow)
  6501. #========================================================================
  6502. # Author:            SMQ
  6503. # Description:        This routine determines whether or not one window 
  6504. #                    completely covers another.  This is done by comparing
  6505. #                    the coordinates of both windows.  
  6506. # Parameters:        pFirstWindow - specifies the first window.
  6507. #                    pSecondWindow - specifies the second window.
  6508. # Returns:            1 - second window is completely covered by the first.
  6509. #                    0 - second window is partially or totally Uncovered.
  6510. # Examples:            CoverCompletely(window1,window2).
  6511. # Assumptions:        None
  6512. #========================================================================
  6513. Calls:    FindWindow(), AdjustRectToScreen(), RectInRect()
  6514. Is called by:    UnCoverWindow()
  6515.  
  6516.  
  6517. Task:    ResetWindow(pTheWindow)
  6518. Library:    UserInterface.lib
  6519. Header:
  6520. #########################################################################
  6521. #                        ResetWindow(pTheWindow)
  6522. #========================================================================
  6523. # Author:            NJV
  6524. # Description:        Resets the first window with a grow and zoom box to
  6525. #                    the size and position of the input parameter wind 
  6526. #                    window descriptor.  
  6527. # Parameters:        pTheWindow - window descriptor of original window.
  6528. # Returns:            0 - error
  6529. #                    1 - no error
  6530. # Examples:            ResetWindow(pTheWindow).
  6531. # Assumptions:        None
  6532. #========================================================================
  6533. Calls:    SelectWindow(), LogStr(), SizeWindow(), DragWindow(), ScrollWindow()
  6534. Is called by:    TestWindow(), SizeAcrossScreens()
  6535.  
  6536.  
  6537. Task:    SelectWindow(pSpecifier := 0) 
  6538. Library:    UserInterface.lib
  6539. Header:
  6540. ########################################################################
  6541. #                        SelectWindow(pSpecifier)
  6542. #=======================================================================
  6543. # Author:        NJV
  6544. # Description:    This routine will select a window specified by
  6545. #                <pSpecifier>.
  6546. # Parameters:    pSpecifier - holds the title or ordinality or window descriptor
  6547. #                            of window to select.
  6548. # Returns:        {theDesc} - Updated window descriptor - Selected window OK
  6549. #                 0 - Couldn't find window to select
  6550. #=======================================================================
  6551. Calls:    FindWindow(), UnCoverWindow(), _select(), Logstr()
  6552. Is called by:    TestWindow(), ResetWindow(), CloseWindow()
  6553.  
  6554.  
  6555. Task:    UnCoverWindow(pSpecifier, pFrontWindow := 1)
  6556. Library:    UserInterface.lib
  6557. Header:
  6558. ########################################################################
  6559. #                        UnCoverWindow(pSpecifier, pFrontWindow)
  6560. #=======================================================================
  6561. # Author:        KTA
  6562. # Description:    This routine will move a window out of the way if it covers
  6563. #                our desired window.
  6564. # Parameters:    pSpecifier -    holds the title or ordinality of window that is desired.
  6565. #                pFrontWindow - window that is in front of the desired one.
  6566. # Returns:        Nothing
  6567. #=======================================================================
  6568. Calls:    FindWindow(), ExceptionDispatcher(), CoverCompletely(), DragWindow()
  6569. Is called by:    SelectWindow()
  6570.  
  6571.  
  6572. Task:    DragWindow(pHorizontalPixels := "Random", pVerticalPixels := "Random", 
  6573.         pSpecifier := 0,pAbsolutely := 1) 
  6574. Library:    UserInterface.lib
  6575. Header:
  6576. #########################################################################
  6577. #    DragWindow(pHorizontalPixels, pVerticalPixels,pSpecifier,pAbsolutely)
  6578. #========================================================================
  6579. # Author:        KTA
  6580. # Description:    This routine will drag the specified window.
  6581. #                <pHorizontalPixels> pixels horizontally (negative drags left) 
  6582. #                and <pVerticalPixels> pixels vertically (negative drags up)
  6583. # Parameters:    pHorizontalPixels - Horizontal pixel offset to drag the window
  6584. #                pVerticalPixels    - Vertical pixel offset to drag the window
  6585. #                pSpecifier - Window specifier
  6586. #                pAbsolutely -    1 if absolute drag
  6587. #                                0 if relative drag
  6588. # Returns:        1 - Dragged window OK
  6589. #                0 - Couldn't find window to drag
  6590. #========================================================================
  6591. Calls:    getXYRandom(), FindWindow(), TCSStart(), _drag(), TCSEnd(), LogStr()
  6592. Is called by:    TestWindow(), WindowFunction(), DragAcrossScreens(), 
  6593.                 SizeAcrossScreens(), ResetWindow(), UnCoverWindow(), 
  6594.                 SetUpDocumentWindow()
  6595.  
  6596.  
  6597. Task:    SizeWindow(pPixelsWide:="random", pPixelsHigh:="random", pSpecifier := 0, 
  6598.         pAbsolutely := 1)
  6599. Library:    UserInterface.lib
  6600. Header:
  6601. #########################################################################
  6602. #                    SizeWindow(pPixelsWide,pPixelsHigh,pSpecifier,pAbsolutely)
  6603. #========================================================================
  6604. # Author:        KTA
  6605. # Description:    This routine will match and resize the specified window.
  6606. #                If only the <pPixelsWide> and <pPixelsHigh> parameters are 
  6607. #                passed, the default behavior will size the first window 
  6608. #                containing a grow and zoom box pAbsolutely.  If no parameters
  6609. #                are passed, then the default behavior will generate random
  6610. #                coordinates on the main screen and resize the window
  6611. #                to an absolute size.  If the user passes in the string
  6612. #                "random" for <pPixelsWide> and <pPixelsHigh> and passes 0 for
  6613. #                the pAbsolutely parameter (for a resize relative to current size),
  6614. #                then checks are performed to assure that new size will
  6615. #                not go off of the screen.  If it does, the values will
  6616. #                be adjusted so that the largest the window can be sized
  6617. #                is to the border of the screen.
  6618. # Parameters:    pPixelsWide - the width to resize the window
  6619. #                pPixelsHigh - the height to resize the window
  6620. #                pSpecifier -    title or ordinality of window to be sized
  6621. #                pAbsolutely -    1 if resize window absolute
  6622. #                                0 if resize window relative
  6623. # Returns:        1 - Resized window OK
  6624. #                0 - Couldn't resize window
  6625. # Examples:        SizeWindow(200,400);
  6626. #========================================================================
  6627. Calls:    FindWindow(), TCSStart(), getXYRandom(), ExceptionDispatcher(), 
  6628.         TCSEnd(), LogStr()
  6629. Is called by:    SetUpDocumentWindow(), WindowFunction(), SizeAcrossScreens(), 
  6630.                 ResetWindow()
  6631.  
  6632.  
  6633. Task:    ZoomWindow(pSpecifier:= 0) 
  6634. Library:    UserInterface.lib
  6635. Header:
  6636. #########################################################################
  6637. #                            ZoomWindow(pSpecifier)
  6638. #========================================================================
  6639. # Author:        KTA
  6640. # Description:    Selects the zoom box on the specified window.  If no
  6641. #                parameters are passed, then the default behavior will
  6642. #                zoom the first window with a zoom box.
  6643. # Parameters:    pSpecifier - window specifier
  6644. # Returns:        0 - Couldn't zoom the window
  6645. #                1 - Zoomed the window OK
  6646. #========================================================================
  6647. Calls:    FindWindow(), TCSStart(), ExceptionDispatcher(), TCSEnd(), LogStr(), 
  6648. Is called by:    WindowFunction()
  6649.  
  6650.  
  6651. Task:    CloseWindow(pHowClose := 3,pOverWrite := 1,pSpecifier := 0,pNewDocName :="") 
  6652. Library:    UserInterface.lib
  6653. Header:
  6654. #########################################################################
  6655. #                CloseWindow(pHowClose, pOverwrite, pSpecifier,pNewDocName)
  6656. #========================================================================
  6657. # Author:        KTA/NJV/DMM
  6658. # Description:    This routine will close the specified window.  If no
  6659. #                parameters are passed to this routine, the default behavior
  6660. #                will select the close box of the first window with a close box.
  6661. # Parameters:    pHowClose -    0 -    tries all three ways noted below to close the
  6662. #                                window (if needed)
  6663. #                            1 -    tries to close window by selecting "Close" menu
  6664. #                                item
  6665. #                            2 -    tries to close window by typing "Close" menu
  6666. #                                item's key equivalent
  6667. #                            3 -    tries to close window by selecting window's
  6668. #                                close box
  6669. #                pOverwrite -    0 -    will select "No" from a save-changes dialog
  6670. #                                if one appears when closing window
  6671. #                            1 -    will select "Yes" to save changes
  6672. #                pSpecifier - window specifier
  6673. #                pNewDocName - string holding new document name - if pOverwrite
  6674. #                            parameter is 1, then pNewDocName will be used for
  6675. #                            naming the file.
  6676. # Returns:        1 - Closed window OK
  6677. #                0 - Couldn't find window to close
  6678. #========================================================================
  6679. Calls:    FindWindow(), SelectWindow(), TCSStart(), SelectMenuItem(), _match(), 
  6680.         KeyEq(), _close(), LogStr(), checkYesNo(), IsStandardFile(), SaveAs(), 
  6681.         _matchBoolean(), TCSEnd()
  6682. Is called by:    Scrapbook(), DoFiles(), DoSetUpApp(), Quit(), CloseAllWindows()
  6683.  
  6684.  
  6685. Task:    ScrollWindow(pWhichScrollBar,pDesirePosition:=-1,pMaxPosition:=-1)
  6686. Library:    UserInterface.lib
  6687. Header:
  6688. ########################################################################
  6689. #                            ScrollWindow(pWhichScrollBar,pDesirePosition,pMaxPosition)
  6690. #=======================================================================
  6691. # Author:        KTA/NJV
  6692. # Description:    This routine will scroll the specified scrollbar on
  6693. #                the active window.
  6694. # Parameters:    pWhichScrollBar = 'H' - for horizontal scrollbar
  6695. #                                = 'V' - for vertical scrollbar
  6696. #                <pDesirePosition><pMaxPosition> = the fraction pDesirePosition/pMaxPosition
  6697. # Returns:        0 - Couldn't scroll the scroll bar
  6698. #                1 - Scrolled the scroll bar
  6699. # Examples:        ScrollWindow('H',1,2)  will scroll the horizontal bar 1/2
  6700. # Assumptions:    That the scrollbars are present. This routine collects
  6701. #                only the first two scroll bars, which are assumed to be 
  6702. #                the horizontal and vertical scroll bars. 
  6703. #                This routine is not 100% reliable.
  6704. #=======================================================================
  6705. Calls:    GetVHScrollBars(), _match(), TCSStart(), ExceptionDispatcher(), 
  6706.         LogStr(), TCSEnd()
  6707. Is called by:    HereToStartSelect(), HereToEndSelect(), SelectAll(), 
  6708.                 PerformScroll(), TimeScrolling(), WindowFunction(), 
  6709.                 ResetWindow()
  6710.  
  6711.  
  6712. Task:    GetVHScrollBars(pSpecifier := [window c:true g:true])
  6713. Library:    UserInterface.lib
  6714. Header:
  6715. ########################################################################
  6716. #                            GetVHScrollBars()
  6717. #=======================================================================
  6718. # Author:            NJV
  6719. # Description:        This routine will return the vertical and horizontal
  6720. #                    scroll bars.
  6721. # Parameters:        pSpecifier - Window descriptor 
  6722. # Returns:            0 - Couldn't find scroll bars
  6723. #                    {vertical,horizontal} - list of vertical and horizontal
  6724. #                                            scroll bars
  6725. # Examples:            scrollBars := GetVHScrollBars();
  6726. # Assumptions:        Top of vertical scroll bar is at a lower vertical value
  6727. #                    that the horizontal (i.e. the top of vertical rect is smaller
  6728. #                    than the top of the horizontal scroll bar's rect).
  6729. #=======================================================================
  6730. Calls:    _collect(), LogStr(), 
  6731. Is called by:    HereToStartSelect(), HereToEndSelect(), SelectAll(), 
  6732.                 WindowFunction(), ScrollWindow()
  6733.  
  6734.  
  6735. Task:    CloseAllWindows()
  6736. Library:    UserInterface.lib
  6737. Header:
  6738. #########################################################################
  6739. #                         CloseAllWindows()
  6740. #=======================================================================
  6741. # Author:          ML
  6742. # Description:    Closes all windows having a close box.
  6743. # Parameters:    None
  6744. # Returns:        Nothing
  6745. # Assuptions:    Windows have close boxes.
  6746. #=======================================================================
  6747. Calls:    FindWindow(), CloseWindow()
  6748. Is called by:    Quit()
  6749.  
  6750.  
  6751. Task:    FindWindow(pSpecifier := "None", pBooleanFlag := false)
  6752. Library:    UserInterface.lib
  6753. Header:
  6754. #########################################################################
  6755. #                            FindWindow(pSpecifier)
  6756. #========================================================================
  6757. # Author:        DM
  6758. # Description:    FindWindow will return the descriptor of the window
  6759. #                specified by the parameter pSpecifier.
  6760. # Parameters:    pSpecifier - if string, then it holds title of window
  6761. #                            if integer, then it holds ordinality of window
  6762. #                            if rect, create a fake window specfier with the
  6763. #                                rect as the wind.r
  6764. #                            if window descriptor will match window meeting 
  6765. #                            the specified traits e.g. [window t:'Mywind' o:2]
  6766. #                            Pass 0 to get the first document window
  6767. #                pBooleanFlag - IF set will return true or false indicating the presence of 
  6768. #                                window specified by <pSpecifier>. Note: No window
  6769. #                                descriptor will be returned.
  6770. # Returns:        0 - Couldn't find the window
  6771. #                descriptor - Window descriptor that meets the specified match
  6772. #                            for <pSpecifier>
  6773. # Example:        FindWindow(1);
  6774. #========================================================================
  6775. Calls:    _matchBoolean(), _match(), LogStr(), _collect(), 
  6776. Is called by:    DoSetUpApp(), CenterofRectClick(), AboutBox(), CalcOffset(), 
  6777.                 PageSetup(), Printer(), RandomTextSelection(), SaveAs(), 
  6778.                 OpenFile(), Polling(), SetUpDocumentWindow(), TestWindow(), 
  6779.                 WindowFunction(), DragAcrossScreens(), SizeAcrossScreens(), 
  6780.                 CoverCompletely(), SelectWindow(), UnCoverWindow(), DragWindow(), 
  6781.                 SizeWindow(), ZoomWindow(), CloseWindow(), CloseAllWindows(), 
  6782.                 GetRandomPointsRelativeToWindow(), DialogHandler(), 
  6783.                 DialogDismisser(), DismissDialog(), MoveRelativeToWindow(), 
  6784.                 DoWPTools()
  6785.  
  6786.  
  6787. Task:    GetRandomPointsRelativeToWindow(pInset := { 0,0,20,20}, pSpecifier := 0, 
  6788.         pNumPts := 1)
  6789. Library:    UserInterface.lib
  6790. Header:
  6791. ########################################################################
  6792. #        GetRandomPointsRelativeToWindow(pInset, pSpecifier, pNumPts)
  6793. #=======================================================================
  6794. # Author:             KTA
  6795. # Description:        Determines what the rectangle is for the window specified 
  6796. #                    as Specifier and returns a random X and Y coordinate which
  6797. #                    will be inside the window if moving relative to the top 
  6798. #                    left corner of the screen or window.
  6799. # Parameters:        pInset - ltrb inset from screen or window
  6800. #                    pSpecifier
  6801. #                            Integer
  6802. #                              > 0 - Ordinality window to find coords in
  6803. #                              = O coords in window with s:doc g:true and c:true
  6804. #                              < 0 coords in specified screen.  Screen numbers
  6805. #                                are negative of pSpecifier.
  6806. #                            String
  6807. #                                title of window to find coords in
  6808. #                            {List}
  6809. #                                any partial or complete window descriptor
  6810. # Returns:            myPoints - List of random X and Y.  eg. { x, y }
  6811. #========================================================================
  6812. Calls:    FindWindow(), GetXYRandom()
  6813. Is called by:    MakePointList()
  6814.  
  6815.  
  6816. Task:    SelectButton(pButton)
  6817. Library:    UserInterface.lib
  6818. Header:
  6819. #########################################################################
  6820. #                        SelectButton(pButton)
  6821. #========================================================================
  6822. # Author:        KTA
  6823. # Description:    This routine will select the button named <pButtonName>
  6824. # Parameters:    pButton - string - holding name of button to select
  6825. #                            integer - ordinality of Button
  6826. # Returns:        0 - Couldn't select button
  6827. #                pButtonName - Selected button OK
  6828. #========================================================================
  6829. Calls:    _match(), logStr(), _move(), gPreSelectButtonHook, _click(), 
  6830. Is called by:    ShimmerMateCopy(), MiniLaunch(), QuitBackgroundApps(), 
  6831.                 AboutBox(), TestPageSetup(), PrintSample(), SFType(), 
  6832.                 ReplaceExist(), Revert(), CancelStandardFile(), 
  6833.                 CheckYesNo(), DialogCheck(), DialogDismisser(), 
  6834.                 DismissDialog()
  6835.  
  6836.  
  6837. Task:    SelectRadioButton(pRadioButton)
  6838. Library:    UserInterface.lib
  6839. Header:
  6840. #######################################################################
  6841. #                    SelectRadioButton(pRadioButton)
  6842. #========================================================================
  6843. # Author:        KTA
  6844. # Description:    This routine will select RadioButton named <pRadioButtonName>
  6845. # Parameters:    pRadioButton - string - name of radio button to select
  6846. #                                integer - radio button ordinality
  6847. # Returns:        0 - Couldn't select radio button
  6848. #                pRadioButtonName - Selected button OK
  6849. #========================================================================
  6850. Calls:    _match(), _Select(), LogStr()
  6851. Is called by:    ShimmerMateCopy(), MiniLaunch(), PaperSize(), PageSize()
  6852.  
  6853.  
  6854. Task:    SelectCheckBox(pCheckBox)
  6855. Library:    UserInterface.lib
  6856. Header:
  6857. #########################################################################
  6858. #                        SelectCheckBox(pCheckBox)
  6859. #========================================================================
  6860. # Author:        KTA
  6861. # Description:    This routine will select CheckBox named <pCheckBoxName>
  6862. # Paramters:    pCheckBox - string - name of check box to select
  6863. #                            integer - ordinality of checkBox
  6864. # Returns:        0 - Couldn't select check box
  6865. #                pCheckBoxName - Selected check box OK
  6866. #========================================================================
  6867. Calls:    _match(), _Select(), LogStr()
  6868. Is called by:    TestCheckBoxList()
  6869.  
  6870.  
  6871. Task:    CheckYesNo(pFlag := true)
  6872. Library:    UserInterface.lib
  6873. Header:
  6874. #########################################################################
  6875. #                CheckYesNo(pFlag)
  6876. #========================================================================
  6877. # Author:        SL
  6878. # Description:    Checks for dialog boxes with "Yes" (or "OK") and "No"
  6879. #                buttons. If they are found, clicks one of the buttons
  6880. #                depending on the 'pFlag' parameter.
  6881. # Parameters:    pFlag -    TRUE - Selects "Yes"  or "OK" button.
  6882. #                        FALSE - Selects "No" button.
  6883. #                DocName - Name that docment will be saved with.
  6884. # Returns:        What is returned by SelectButton
  6885. #========================================================================
  6886. Calls:    _matchBoolean(), SelectButton(), _match()
  6887. Is called by:    Quit(), CloseWindow()
  6888.  
  6889.  
  6890. Task:    DialogCheck(pFindStaticText :='', pCommitButton :="", pLogIT := 1, 
  6891.         pWindowDesc := [window o:1 c:false])
  6892. Library:    UserInterface.lib
  6893. Header:
  6894. ########################################################################
  6895. #        DialogCheck(pFindStaticText,pCommitButton, pLogIT, pWindowDesc)
  6896. #=======================================================================
  6897. # Author:        KTA
  6898. # Description:    This routine will to match a dialog of specified by <pWindowDesc>,
  6899. #                with static text - <pFindStaticText>, if found it will select the 
  6900. #                Button - {pCommitButton}. If <pFindStaticText> is not defined a
  6901. #                match will be made on any dialog with static text.
  6902. # Parameters:    pFindStaticText - Static text string that you want to match
  6903. #                pCommitButton   - Button to select if the static text is found.
  6904. #                pLogIT - If you don't want to log the dialog pass 0
  6905. #                pWindowDesc - window descriptor of dialog
  6906. # Returns:        <Static Text> - the Static Text String found pFindStaticText 
  6907. #                and selected pCommitButton
  6908. #                0 - Couldn't find pFindStaticText
  6909. #=======================================================================
  6910. Calls:    _matchBoolean(), _collect(), IsSubString(), LogStr(), SelectButton(), 
  6911.         SpecialKey(), 
  6912. Is called by:    DrawObject(), ReportSelectedMenuItems(), MiniLaunch(), 
  6913.                 LaunchAssist(), LaunchTwitch(), SaveAs(), OpenFile(), 
  6914.                 Revert(), TimeCutPaste(), SelectMenuItem(), 
  6915.  
  6916.  
  6917. Task:    DialogHandler(pSpecifier := [window o:1 s:movablemodal c:false]!)
  6918. Library:    UserInterface.lib
  6919. Header:
  6920. #########################################################################
  6921. #                        DialogHandler(pSpecifier)
  6922. #========================================================================
  6923. # Author:        KTA 
  6924. # Description:    Keep calling DialogDimisser() while there is a dialog present.
  6925. # Parameters:    pSpecifier - dialog descriptor.
  6926. # Returns:        0 - Unsuccessful
  6927. #                -1 - There were no dialogs to dismiss
  6928. #                returnVal >= 1 - Successful All dialog were dismissed. Indicates 
  6929. #                                the number of dialogs that were idsmissed.
  6930. # Examples:        DialogHandler();
  6931. # Assumptions:    None 
  6932. #========================================================================
  6933. Calls:    findwindow(), ExceptionDispatcher(), 
  6934. Is called by:    Quit(), TCSEnd()
  6935.  
  6936.  
  6937. Task:    DialogDismisser( pHowToDismiss := 'All', pSpecifier := [window o:1 c:false]!, 
  6938.         pSpecifiedDialog := false)
  6939. Library:    UserInterface.lib
  6940. Header:
  6941. #########################################################################
  6942. #                        DialogDismisser(pHowToDismiss, pSpecifier)
  6943. #========================================================================
  6944. # Author:        KTA 
  6945. # Description:    Dismiss dialogs using one of several methods (or all)
  6946. # Parameters:    pHowToDismiss
  6947. #                    1 - Command - '.'
  6948. #                    2 - Escape key
  6949. #                    3 - 'Cancel' Button
  6950. #                    4 - 'No' button
  6951. #                    5 - 'Don't Save' button
  6952. #                    6 - 'OK' button
  6953. #                    7 - 'Quit' button
  6954. #                    8 - type 'Return Key' 
  6955. #                    String - 
  6956. #                        'All' - all methods above
  6957. #                        Any other string - SelectButton(<string>).
  6958. #                pSpecifier - dialog descriptor.
  6959. # Returns:        0 - Unsuccessful
  6960. #                (non-zero) - Successful All dialog were dismissed.
  6961. # Examples:        DialogDismisser();
  6962. # Assumptions:    None 
  6963. #========================================================================
  6964. Calls:    _MatchBoolean(), FindWindow(), KeyEq(), SpecialKey(), SelectButton(), 
  6965.         _match(), DialogDismisser(), LogStr()
  6966. Is called by:    DialogHandler(), DialogDismisser
  6967.  
  6968.  
  6969. Task:    DismissDialog (pHowToDismiss := 1, pSpecifier := [window o:1 c:false]!)
  6970. Library:    UserInterface.lib
  6971. Header:
  6972. #########################################################################
  6973. #                     DismissDialog(pHowToDismiss, pSpecifier)
  6974. #=======================================================================
  6975. # Author:              ML
  6976. # Description:        Generic dialog dismisser.
  6977. # Assumptions:        Window is style dialog and ordinality 1.
  6978. # Parameters:        pHowToDismiss -    1    type return key
  6979. #                                {string} select button named {string}        
  6980. # Returns:            0 - dialog not dismissed
  6981. #                    1 - dialog sucessfully dismissed
  6982. # Example:            DismissDialog ('Cancel')
  6983. #=======================================================================
  6984. Calls:    FindWindow(), SpecialKey(), keyEq(), selectbutton(), _matchBoolean(), 
  6985.         logstr(), 
  6986. Is called by:    DoSetUpApp()
  6987.  
  6988.  
  6989. Task:    MoveRelativeToWindow(pHorizontalPixels:= 'random', pVerticalPixels:= 'random', 
  6990.         pSpecifier:=0,pMouseDown:=0,pInset:= {30,30,30,30}, WhichCorner := 1)
  6991. Library:    UserInterface.lib
  6992. Header:
  6993. #########################################################################
  6994. # MoveRelativeToWindow(pHorizontalPixels, pVerticalPixels, pSpecifier,pMouseDown,pInset)
  6995. #========================================================================
  6996. # Author:        NJV
  6997. # Description:    This routine will calculate the window's rectangle
  6998. #                and add pHorizontalPixels and pVerticalPixels input parameters  
  6999. #                to the rectangle's top-left coordinate point.  It will then
  7000. #                move the mouse to that location.  The window is
  7001. #                specified by the pSpecifier input parameter.  If the
  7002. #                pSpecifier parameter is not present, the default
  7003. #                behavior will move relative to the frontmost document window.
  7004. # Parameters:    pHorizontalPixels - int representing left (pHorizontalPixels) coord 
  7005. #                    or List of points.
  7006. #                pVerticalPixels - int representing top (pVerticalPixels) coord
  7007. #                pSpecifier - holds title or ordinality of window
  7008. #                            0 matches first s:document c:true g:true window
  7009. #                pMouseDown - (see MoveMouse())
  7010. #                pInset    -   inset from window rect for GetXYRandom
  7011. #                WhichCorner - Relative to which corner of the window
  7012. #                            1 - Top/Left
  7013. #                            2 - Bottom/Left
  7014. # Returns:        Nothing
  7015. # Examples:        MoveRelativeToWindow(12,25);
  7016. # Assumptions:    Assumes there is a window on the screen 
  7017. #========================================================================
  7018. Calls:    GetRandomPointsRelativeToWindow(), FindWindow(), MoveMouse()
  7019. Is called by:    UseClickTool(), UseDragTool(), UseDragClickTool(), UseMultiDragTool(), 
  7020.                 UseMultiClickTool(), UseMultiClickDragTool(), UseDragOffTool(), 
  7021.                 NextLine(), SelFromDocWind(), SelFromCoord(), SelFromPopUp(), 
  7022.                 SelFromMenuItemPopUp(), PageSize(), ToggleOrientation(), 
  7023.                 PointSelect(), RectSelect(), HereToStartSelect(), HereToEndSelect(), 
  7024.                 SelectAll(), RandomTextSelection()
  7025.  
  7026.  
  7027. Task:    MoveMouse(pHorizontalPixels := 'random', pVerticalPixels := 'random', 
  7028.         pAbsolutely := 1, pMouseDown := 0)
  7029. Library:    UserInterface.lib
  7030. Header:
  7031. #########################################################################
  7032. #                 MoveMouse(pHorizontalPixels, pVerticalPixels, pAbsolutely, pMouseDown)
  7033. #========================================================================
  7034. # Author:        DMM
  7035. # Description:    This routine will move the mouse pHorizontalPixels,pVerticalPixels
  7036. #                relative to its current location  If pHorizontalPixels and 
  7037. #                pVerticalPixels are absent or equal to "random", a random move is generated.
  7038. # Parameters:    pAbsolutely - 1 if move pAbsolutely, 0 if relative
  7039. #                pHorizontalPixels - horizontal distance in pixels to move mouse 
  7040. #                pVerticalPixels - vertical distance in pixels to move mouse
  7041. #                                if pHorizontalPixels and pVerticalPixels are absent
  7042. #                                or := "random" then a random move is generated.
  7043. #                pAbsolutely    -    1 to move to absolute location
  7044. #                                0 to move relative to current location
  7045. #                pMouseDown - 0 - don't hold mouse key down while moving
  7046. #                            1 - press mouse key down - move - release (can be a list of 1 element)
  7047. #                            2 - Click after moving - no mouse down during move
  7048. #                            3 - press mouse key down - move - don't release
  7049. #pHorizontalPixels is List    3 - MultiDrag (pressmouse-move-move-move-releaseMouse)
  7050. #                            4 - move - release
  7051. #pHorizontalPixels is List    5 - MultiClick (move-click-move-click)
  7052. #pHorizontalPixels is List    6 - move-pressmouse-move-move-move-releaseMouse
  7053. # Returns:        Nothing
  7054. #========================================================================
  7055. Calls:    getXYRandom(), _PressMouse(), gPreMoveMouseHook, _move(), _click(), 
  7056.         _releaseMouse(), LogStr()
  7057. Is called by:    SelFromDocWind(), SelFromPalWind(), SelFromCoord(), 
  7058.                 SelFromPopUp(), SelFromMenuItemPopUp(), PointSelect(), 
  7059.                 RectSelect(), SFSelectPopupMenuItem(), MoveRelativeToWindow()
  7060.  
  7061.  
  7062. Task:    TypeStr(pTheString :='')
  7063. Library:    UserInterface.lib
  7064. Header:
  7065. #########################################################################
  7066. #                                TypeStr(pTheString)
  7067. #========================================================================
  7068. # Author:        KTA
  7069. # Description:    This routine will type the string that is passed in as 
  7070. #                the <pTheStringing>.
  7071. # Parameters:    pTheString - The string to be typed
  7072. # Returns:        Nothing
  7073. # Note: If gTypeStrOverRide is defined as a task reference, it will have to handle
  7074. #        all actions all of the functionality of TypeStr since it is being overriden.
  7075. #========================================================================
  7076. Calls:    gTypeStrOverRide, _type(), LogStr()
  7077. Is called by:    DoText(), DrawObject(), FinderNavigate(), 
  7078.                 ReportSelectedMenuItems(), MiniLaunch(), LaunchByTypeSelect(), 
  7079.                 PageSize(), SaveAs(), OpenFile(), ReplaceExist(), 
  7080.                 ModifyDocument()
  7081.  
  7082.  
  7083. Task:    TypeList(pStringList,pSpecialKey := 0, pTypeFinalKey := 0)
  7084. Library:    UserInterface.lib
  7085. Header:
  7086. #########################################################################
  7087. #                        TypeList(pStringList,pSpecialKey, pTypeFinalKey)
  7088. #========================================================================
  7089. # Author:            KTA
  7090. # Description:        This routine will type each item in the {pStringList} 
  7091. #                    and the selected special key, designated by the <pSpecialKey> 
  7092. #                    input parameter, after each item. If pTypeFinalKey = 0 the 
  7093. #                    special key will be suppressed after the last item.
  7094. # Parameters:        pStringList -    list holding strings to type
  7095. #                    pSpecialKey    -    integer representing key to type after the item has
  7096. #                            been typed. 
  7097. #                        pSpecialKey := 0 Nothing
  7098. #                        pSpecialKey := 1 (ReturnKey)
  7099. #                        pSpecialKey := 2 (TabKey)
  7100. #                        pSpecialKey := 3 (EnterKey)
  7101. #                        pSpecialKey := 4 (UpArrowKey)
  7102. #                    pTypeFinalKey - 1 to type special key after last item in <pStringList>
  7103. #                            0 to disable typing of last special key
  7104. # Return Value:        None
  7105. # Examples:            TypeList({'A','list', 'of items'},2); To type each item 
  7106. #                    and then the tabKey
  7107. # Assumptions:        None 
  7108. #========================================================================
  7109. Calls:    _Type(), LogStr()
  7110. Is called by:    ShimmerMateCopy(), SFType()
  7111.  
  7112.  
  7113. Task:    SpecialKey( pTheKey, pKeyName := "", pNumTimes := 1 )
  7114. Library:    UserInterface.lib
  7115. Header:
  7116. #########################################################################
  7117. #                SpecialKey( pTheKey, pKeyName, pNumTimes )
  7118. #========================================================================
  7119. # Author:        KTA
  7120. # Description:    This routine will type whatever SpecialKey is entered
  7121. #                However it will only log the name of the special character 
  7122. #                if the special key name is also passed in as a String in
  7123. #                the pKeyName parameter.
  7124. # Parameters:    pTheKey - the VU key-word for the special key to be typed
  7125. #                            (i.e. ReturnKey, TabKey, EnterKey, etc.)
  7126. #                pKeyName - the string name of the special key
  7127. #                pNumTimes - number of times to type the special key (default = 1)
  7128. # Returns:        Nothing
  7129. # Examples:        SpecialKey(TabKey,"TabKey");
  7130. #========================================================================
  7131. Calls:    LogStr(), gPreSpecialKeyHook, _type()
  7132. Is called by:    ShimmerMateCopy(), NextLine(), MiniLaunch(), 
  7133.                 QuitBackgroundApps(), AboutBox(), PrintSample(), PageSetup(), 
  7134.                 Printer(), SaveAs(), OpenFile(), ReplaceExist(), Revert(), 
  7135.                 CancelStandardFile(), DialogCheck(), DialogDismisser(), 
  7136.                 DismissDialog()
  7137.  
  7138.  
  7139.  
  7140.  
  7141.  
  7142.  
  7143.  
  7144.  
  7145.  
  7146. ##############################################################
  7147. ##############################################################
  7148. ##############################################################
  7149. Library: Utility.lib
  7150. Calls: 
  7151.  
  7152.  
  7153. Task:    Timer(timeParam:=1)
  7154. Library:    Utility.lib
  7155. Header:
  7156. #########################################################################
  7157. #                             Timer(timeParam)
  7158. #=======================================================================
  7159. # Author:              DM
  7160. # Description:        Calculates the time between two time descriptors 
  7161. # Parameters:        timeParam - Specifier - what to return
  7162. #                    1 - return (theTime) - full descriptor
  7163. #                    2 - return ({"{theHour}:{theSec}",theHour,theSec});
  7164. #                    3 - return (("{theMonth}/{theDay}/{theYear}"))
  7165. #                    4 - CurrentTime - formatted
  7166. # Example:            Timer(1);
  7167. #=======================================================================
  7168. Calls:    
  7169. Is called by:    StartTimerVU(), StopTimerVU(), BeginTimer(), EndTimer()
  7170.  
  7171.  
  7172. Task:    ETime(time1, time2, mode := 1)
  7173. Library:    Utility.lib
  7174. Header:
  7175. #########################################################################
  7176. #                 ETime(time1, time2, mode)
  7177. #=======================================================================
  7178. # Author:              DM
  7179. # Description:        Calculates the time between two time descriptors 
  7180. # Parameters:        time1, time2 - times to compare
  7181. # Returns:            mode := 0 Difference between the two in secs
  7182. # Returns:            mode := 1 Difference between the two "{eh}:{em}:{es}"
  7183. # Example:            ETime(time1, time2);
  7184. #=======================================================================
  7185. Calls:    
  7186. Is called by:    StopTimerVU(), EndTimer()
  7187.  
  7188.  
  7189. Task:    BeginTimer()
  7190. Library:    Utility.lib
  7191. Header:
  7192. #########################################################################
  7193. #             BeginTimer()
  7194. #=======================================================================
  7195. # Author:              ML
  7196. # Description:        Starts the timer
  7197. # Parameters:        none
  7198. # Returns:            None
  7199. #=======================================================================
  7200. Calls:
  7201. Is called by:    SuiteStart()
  7202.  
  7203.  
  7204. Task:    EndTimer()
  7205. Library:    Utility.lib
  7206. Header:
  7207. #########################################################################
  7208. #             EndTimer()
  7209. #=======================================================================
  7210. # Author:              ML
  7211. # Description:        Ends the timer
  7212. # Parameters:        none
  7213. # Returns:            None
  7214. #=======================================================================
  7215. Calls:    ETime()
  7216. Is called by:    SuiteEnd()
  7217.  
  7218.  
  7219. Task:    GetCurrentTime(NeedMeridian := true, returnDate := true)
  7220. Library:    Utility.lib
  7221. Header:
  7222. #########################################################################
  7223. #             GetCurrentTime(NeedMeridian, returnDate)
  7224. #=======================================================================
  7225. # Author:              Derived from VU Example Libraries
  7226. # Description:        This task returns the current time.  The format is as follows:
  7227. #                    <hour of day>:<minutes>:<seconds> <AM or PM>
  7228. #                    It also takes one parameter that indicates whether the 
  7229. #                    date should be printed. If the actual parameter passed 
  7230. #                    is a true value, the current date is also printed.
  7231. #                    If no parameter is passed, the date is printed by default.
  7232. #                    The format of the date is as follows:
  7233. #                        <month>/<day>/<year>
  7234. # Parameters:        NeedMeridian - Adds AM/PM if true
  7235. #                    returnDate -  Adds date if true
  7236. # Returns:            Current Time (& Date) string
  7237. #=======================================================================
  7238. Calls:    
  7239. Is called by:    SuiteEnd(), BuildSuiteFields()
  7240.  
  7241.  
  7242.  
  7243.  
  7244.  
  7245.  
  7246.  
  7247.  
  7248.  
  7249. ##############################################################
  7250. ##############################################################
  7251. ##############################################################
  7252. Library: WordProcessor.lib
  7253. Calls: Libraries  "DoTasks.Lib","UserInterface.Lib", "ExceptionHandling.Lib";
  7254.  
  7255.  
  7256.  
  7257. Task:    DoWPTools()
  7258. Library:    WordProcessor.lib
  7259. Header:
  7260. #########################################################################
  7261. #                        DoWPTools()
  7262. #========================================================================
  7263. # Author:        ML
  7264. # Description:    Test Word Processor Tools.
  7265. # Parameters:    RulerRect,TabToolList,OtherToolList,SelectAllFlag
  7266. # Returns:        Nada
  7267. # Examples:        DoWPTools();
  7268. # Assumptions:    Word
  7269. #========================================================================
  7270. Calls:    _matchBoolean(), selectmenuitem(), FindWindow(), DoDraw(), 
  7271. Is called by:    
  7272.  
  7273.  
  7274.  
  7275.  
  7276.  
  7277.  
  7278.  
  7279.  
  7280.  
  7281. ##############################################################
  7282. ##############################################################
  7283. ##############################################################
  7284. Library: WorldReady.lib
  7285. Calls: "Output.Lib", "UserInterface.Lib", "ExceptionHandling.Lib";
  7286.  
  7287.  
  7288.  
  7289. Task:    InitINTLGlobals(pAppLanguage := '', pScriptSystem := {}, 
  7290.         pDefinedAppLanguages := {})
  7291. Library:    WorldReady.lib
  7292. Header:
  7293. #########################################################################
  7294. #                    InitINTLGlobals()    
  7295. #========================================================================
  7296. # Author:        KTA
  7297. # Description:    Redefines several global varibles based on resources that are set
  7298. #                up for specific language systems.
  7299. # Parameters:    None
  7300. # Returns:        Nothing
  7301. # Example:        InitINTLGlobals();
  7302. #========================================================================
  7303. Calls:    WhichLanguageResources(), WhatResourceBase(), GetIndString(), 
  7304.         IntlStandardFileHooks(), BuildListFromResourceINTL(), 
  7305. Is called by:    
  7306.  
  7307.  
  7308. Task:    WhichLanguageResources(pAppLanguage := '', pScriptSystem := {}, 
  7309.         pDefinedAppLanguages := {})
  7310. Library:    WorldReady.lib
  7311. Header:
  7312. #########################################################################
  7313. #    WhichLanguageResources( pAppLanguage, pScriptSystem, pDefinedAppLanguages )    
  7314. #========================================================================
  7315. # Author:        KTA
  7316. # Description:    Sets up globals required to swap resources for different language systems. 
  7317. # Parameters:    pAppLanguage := Language of the application to be tested (should be
  7318. #                                language identifier see below)
  7319. #                pScriptSystem := List of 2 elements
  7320. #                                1st element - Language of the script system (language identifier)
  7321. #                                2nd element - Boolean indicating whether script system is
  7322. #                                             localized or not.
  7323. #                                3rd element - Language Identifier for the language for the
  7324. #                                            gFontList and gTextStr. This is an optional paramter,
  7325. #                                            if it does not exist these will default to the language
  7326. #                                            of the primary script system
  7327. #                pDefinedAppLanguages - list of defined languages for the script
  7328. # Returns:        nothing - but it sets up several globals
  7329. # Example:        WhichLanguageResources('AB',{'AB',0} );
  7330. # Notes:        Language Identifier
  7331. #                    US - US
  7332. #                    JP - Japanese
  7333. #                    SC - Simplified Chinese
  7334. #                    TC - Traditional Chinese
  7335. #                    KH - Korean
  7336. #                    AB - Arabic
  7337. #                    HB - Hebrew
  7338. #                    TH - Thai
  7339. #                Global gLanguageSettings is defined as follows:
  7340. #                    {
  7341. #                    Application Language - (e.g. 'US')
  7342. #                        { 
  7343. #                            Primary Script Language (e.g. 'JP'), 
  7344. #                            Is Primary Script Localized (i.e. 0 - NO, 1 - Yes),
  7345. #                            Language for Fonts and TextStr (e.g. 'JP')
  7346. #                        }
  7347. #                    }
  7348. #                    For example:
  7349. #                        gLanguageSettings := {'US',{'JP',0,'JP'}};
  7350. #========================================================================
  7351. Calls:    PrimaryScript(), LogStr(), WhatResourceBase(), _matchBoolean()
  7352. Is called by:    InitINTLGlobals()
  7353.  
  7354.  
  7355. Task:    IntlStandardFileHooks()
  7356. Library:    WorldReady.lib
  7357. Header:
  7358. #########################################################################
  7359. #                        IntlStandardFileHooks()    
  7360. #========================================================================
  7361. # Author:        KTA
  7362. # Description:    Set up defaults for always manipulating StandardFile in US then 
  7363. #                switching back to original script 
  7364. # Parameters:    None
  7365. # Returns:        nothing - but it defines several global hooks
  7366. # Example:        IntlStandardFileHooks();
  7367. #                    
  7368. #========================================================================
  7369. Calls:
  7370. Is called by:    InitINTLGlobals()
  7371.  
  7372.  
  7373. Task:    MenuTitle(menuItemOrd, MenuOrd, Hmenu := 0)
  7374. Library:    WorldReady.lib
  7375. Header:
  7376. #########################################################################
  7377. #            MenuTitle( menuItemOrd, MenuOrd, Hmenu )    
  7378. #========================================================================
  7379. # Author:        KTA
  7380. # Description:    Returns the title of the menuitem specified by the parameters
  7381. #                in ordinality.
  7382. # Parameters:    menuItemOrd - (integer) ordinality of menuItem
  7383. #                MenuOrd - (integer) ordinality of menu (if its hierarchical 
  7384. #                            this is the second level menu).
  7385. #                Hmenu - (integer) ordinality of menu ( only defined if it
  7386. #                        the menuitem is a hierarchical.  This is the top most
  7387. #                        menu.
  7388. # Returns:        {theMITitle,theMenuHTitle, theMenuTitle};
  7389. # Example:        MenuTitle(2,3,4);
  7390. #========================================================================
  7391. Calls:    ExceptionDispatcher(), 
  7392. Is called by:    
  7393.  
  7394.  
  7395. Task:    WhichScript(scriptTitle := '')
  7396. Library:    WorldReady.lib
  7397. Header:
  7398. #########################################################################
  7399. #            WhichScript( scriptTitle )    
  7400. #========================================================================
  7401. # Author:        KTA
  7402. # Description:    Returns the current and primary scripts installed 
  7403. # Parameters:    scriptTitle := Requested script - Will select the script <ScriptTitle>
  7404. #                if it is installed
  7405. # Returns:        {currentScript,primaryScript} - if successful
  7406. #                0 - if failure
  7407. # Example:        WhichScript('Arabic');
  7408. #========================================================================
  7409. Calls:    _matchBoolean(), _collect(), _select(), ExceptionDispatcher()
  7410. Is called by:    
  7411.  
  7412.  
  7413. Task:    CurrentlySelectedScript()
  7414. Library:    WorldReady.lib
  7415. Header:
  7416. #########################################################################
  7417. #                    CurrentlySelectedScript()    
  7418. #========================================================================
  7419. # Author:        KTA
  7420. # Description:    Returns the language identifier for the currently selected script
  7421. #                system (see below for language identifiers.)
  7422. # Parameters:    none
  7423. # Returns:        0 - if failure
  7424. #                language identifier of selected script - if successful
  7425. #                    RM - Roman
  7426. #                    JP - Japanese
  7427. #                    SC - Simplified Chinese
  7428. #                    TC - Traditional Chinese
  7429. #                    KH - Korean
  7430. #                    AB - Arabic
  7431. #                    HB - Hebrew
  7432. #                    TH - Thai
  7433. # Example:        CurrentlySelectedScript();
  7434. #========================================================================
  7435. Calls:    ExceptionDispatcher(), 
  7436. Is called by:    SwitchScript(), SwitchScriptToUS(), SwitchScriptBackToOrig(), 
  7437.                 HandleDoubleByteStrings()
  7438.  
  7439.  
  7440. Task:    PrimaryScript()
  7441. Library:    WorldReady.lib
  7442. Header:
  7443. #########################################################################
  7444. #                    PrimaryScript()    
  7445. #========================================================================
  7446. # Author:        KTA
  7447. # Description:    Returns the language identifier for the primary script
  7448. #                system (see below for language identifiers.)
  7449. # Parameters:    none
  7450. # Returns:        0 - if failure
  7451. #                language identifier of selected script - if successful
  7452. #                    RM - Roman
  7453. #                    JP - Japanese
  7454. #                    SC - Simplified Chinese
  7455. #                    TC - Traditional Chinese
  7456. #                    KH - Korean
  7457. #                    AB - Arabic
  7458. #                    HB - Hebrew
  7459. #                    TH - Thai
  7460. # Example:        PrimaryScript();
  7461. #========================================================================
  7462. Calls:    ExceptionDispatcher()
  7463. Is called by:    WhichLanguageResources(), HandleDoubleByteStrings()
  7464.  
  7465.  
  7466. Task:    WhichMenuIsKeyBoardMenu(pKeyBoardMenuString := 'About Keyboards…')
  7467. Library:    WorldReady.lib
  7468. Header:
  7469. #########################################################################
  7470. #            WhichMenuIsKeyBoardMenu(pKeyBoardMenuString)    
  7471. #========================================================================
  7472. # Author:        KTA
  7473. # Description:    Returns the ordinality of the KeyBoard menu. 
  7474. # Parameters:    pKeyBoardMenuString := String 'About KeyBoards'
  7475. #                    ( This could be different if system is localized)
  7476. # Returns:        ordinality of the KeyBoard menu - if successful
  7477. #                0 - if failure
  7478. # Example:        WhichMenuIsKeyBoardMenu('About Keyboards…');
  7479. #========================================================================
  7480. Calls:    _matchBoolean(), ExceptionDispatcher(), 
  7481. Is called by:    IsScriptInstalled(), SwitchScript()
  7482.  
  7483.  
  7484. Task:    StringsToSelectScript(pLanguageCode := '')
  7485. Library:    WorldReady.lib
  7486. Header:
  7487. #########################################################################
  7488. #            StringsToSelectScript( pLanguageCode )    
  7489. #========================================================================
  7490. # Author:        KTA
  7491. # Description:    Returns the a list which contains all of the strings for 
  7492. #                the script so you can select it from the keyBoards menu.
  7493. # Parameters:    pLanguageCode := Two letter language identifier (see below)
  7494. #                    US - U.S.
  7495. #                    JP - Japanese
  7496. #                    SC - Simplified Chinese
  7497. #                    TC - Traditional Chinese
  7498. #                    KH - Korean
  7499. #                    AB - Arabic
  7500. #                    HB - Hebrew
  7501. #                    TH - Thai
  7502. # Returns:        0 - if failure
  7503. #                List containing strings that are actually in the Keyboard menu
  7504. #                for that language. - if successful#                    
  7505. # Example:        StringsToSelectScript('AB');
  7506. #========================================================================
  7507. Calls:    
  7508. Is called by:    IsScriptInstalled(), SwitchScript()
  7509.  
  7510.  
  7511. Task:    IsScriptInstalled(pTheScript:= '')
  7512. Library:    WorldReady.lib
  7513. Header:
  7514. #########################################################################
  7515. #            IsScriptInstalled( pTheScript )    
  7516. #========================================================================
  7517. # Author:        KTA
  7518. # Description:    Returns a boolean which indicates whether the input parameter
  7519. #                <pTheScript> is installed.
  7520. # Parameters:    pTheScript - language identifier for script 
  7521. #                    US - U.S.
  7522. #                    JP - Japanese
  7523. #                    SC - Simplified Chinese
  7524. #                    TC - Traditional Chinese
  7525. #                    KH - Korean
  7526. #                    AB - Arabic
  7527. #                    HB - Hebrew
  7528. #                    TH - Thai
  7529. # Returns:        1 - if script is installed
  7530. #                0 - if script is not installed
  7531. # Example:        IsScriptInstalled('US');
  7532. #========================================================================
  7533. Calls:    StringsToSelectScript(), WhichMenuIsKeyBoardMenu(), _matchBoolean()
  7534. Is called by:    SwitchScript()
  7535.  
  7536.  
  7537. Task:    BuildListFromResourceINTL(idNum)
  7538. Library:    WorldReady.lib
  7539. Header:
  7540. #########################################################################
  7541. #                        BuildListFromResourceINTL( idNum )
  7542. #========================================================================
  7543. # Author:        KTA 
  7544. # Description:    Returns a list generated from all of the strings in a specified
  7545. #                string list resource specified by <idNum>.
  7546. # Parameters:    idNum := resource id number for the string list resource.
  7547. # Returns:        list - all strings in specified string list resource.
  7548. # Examples:        BuildListFromResource( 1000 ); 
  7549. # Assumptions:    This task must be contained within the same file that contains
  7550. #                the resources. Currently this task only supports up to 100 strings
  7551. #                in a single str# resource.
  7552. # Note:            A duplicate of this task exists in 'Globals.Lib'.  The reason
  7553. #                for this is that Vu has a limitation in the way it handles 
  7554. #                resources in that it requires that a full path to the file be
  7555. #                provided or the resources exist in the current file.  Since we
  7556. #                do not have access to a fullpath, and do not want to require
  7557. #                all users to name their hard drives and folders the same, we
  7558. #                opted to place a duplicate copy of this task in all files that 
  7559. #                want to use it.  The naming convesion is to append the name
  7560. #                of the application under test to the end of the task name.
  7561. #                For example, BuildListFromResourceMacDraw()
  7562. #========================================================================
  7563. Calls:    GetIndString()
  7564. Is called by:    InitINTLGlobals()
  7565.  
  7566.  
  7567. Task:    SwitchScript(pWhichScript := '')
  7568. Library:    WorldReady.lib
  7569. Header:
  7570. #########################################################################
  7571. #            SwitchScript( pTheScript )    
  7572. #========================================================================
  7573. # Author:        KTA
  7574. # Description:    Selects the specified script from the KeyBoard Menu
  7575. # Parameters:    pTheScript - language identifier for script 
  7576. #                    US - U.S.
  7577. #                    JP - Japanese
  7578. #                    SC - Simplified Chinese
  7579. #                    TC - Traditional Chinese
  7580. #                    KH - Korean
  7581. #                    AB - Arabic
  7582. #                    HB - Hebrew
  7583. #                    TH - Thai
  7584. # Returns:        1 - if script is switched to
  7585. #                0 - if script is not switched to
  7586. # Example:        SwitchScript('US');
  7587. #========================================================================
  7588. Calls:    IsScriptInstalled(), StringsToSelectScript(), WhichMenuIsKeyBoardMenu(), 
  7589.         _match(), ExceptionDispatcher(), _select(), LogStr(), 
  7590.         CurrentlySelectedScript(), _PressKey(), _Type(), _releaseKey(), 
  7591.         KeyEq(), 
  7592. Is called by:    SwitchScriptToUS(), SwitchScriptBackToOrig(), 
  7593.                 HandleDoubleByteStrings()
  7594.  
  7595.  
  7596. Task:    SwitchScriptToUS()
  7597. Library:    WorldReady.lib
  7598. Header:
  7599. #########################################################################
  7600. #                SwitchScriptToUS()    
  7601. #========================================================================
  7602. # Author:        KTA
  7603. # Description:    Selects the US script from the KeyBoard Menu
  7604. # Parameters:    None 
  7605. # Returns:        what SwitchScript returns
  7606. # Example:        SwitchScriptToUS();
  7607. #========================================================================
  7608. Calls:    CurrentlySelectedScript(), SwitchScript()
  7609. Is called by:    TimeSaveAs(), TimeOpenFile(), TypeEnglishText()
  7610.  
  7611.  
  7612. Task:    SwitchScriptBackToOrig()
  7613. Library:    WorldReady.lib
  7614. Header:
  7615. #########################################################################
  7616. #                SwitchScriptBackToOrig()    
  7617. #========================================================================
  7618. # Author:        KTA
  7619. # Description:    Selects the script specified by the global <gtheCurrentScript>
  7620. #                from the KeyBoard Menu
  7621. # Parameters:    None 
  7622. # Returns:        what SwitchScript returns
  7623. # Example:        SwitchScriptBackToOrig();
  7624. #========================================================================
  7625. Calls:    CurrentlySelectedScript(), SwitchScript()
  7626. Is called by:    TimeSaveAs(), TimeOpenFile(), TypeEnglishText()
  7627.  
  7628.  
  7629. Task:    WhatResourceBase(pLanguageIdentifier := '')
  7630. Library:    WorldReady.lib
  7631. Header:
  7632. #########################################################################
  7633. #            WhatResourceBase(pLanguageIdentifier)    
  7634. #========================================================================
  7635. # Author:        KTA
  7636. # Description:    Returns a Resource base number for a given language identifier 
  7637. # Parameters:    pLanguageIdentifier := 
  7638. #                    US - US
  7639. #                    JP - Japanese
  7640. #                    SC - Simplified Chinese
  7641. #                    TC - Traditional Chinese
  7642. #                    KH - Korean
  7643. #                    AB - Arabic
  7644. #                    HB - Hebrew
  7645. #                    TH - Thai
  7646. #
  7647. # Returns:        Integer which is the base resource for that particular language
  7648. # Example:        mybaseRes := WhatResourceBase('AB');
  7649. #                    
  7650. #========================================================================
  7651. Calls:    
  7652. Is called by:    InitINTLGlobals(), WhichLanguageResources(), TypeEnglishText()
  7653.  
  7654.  
  7655. Task:    TypeEnglishText()
  7656. Library:    WorldReady.lib
  7657. Header:
  7658. #########################################################################
  7659. #                    TypeEnglishText()    
  7660. #========================================================================
  7661. # Author:        KTA
  7662. # Description:    Switches to the U.S. script system, type a line of english text 
  7663. #                and switches back to the original script.
  7664. # Parameters:    none
  7665. # Returns:        nothing
  7666. # Example:        TypeEnglishText();
  7667. #                    
  7668. #========================================================================
  7669. Calls:    SwitchScriptToUS(), WhatResourceBase(), GetIndString(), _type(), 
  7670.         SwitchScriptBackToOrig()
  7671. Is called by:    
  7672.  
  7673.  
  7674. Task:    GenerateStandardFontRecord()
  7675. Library:    WorldReady.lib
  7676. Header:
  7677. #########################################################################
  7678. #                    GenerateStandardFontRecord()    
  7679. #========================================================================
  7680. # Author:        KTA
  7681. # Description:    Generates a font record based on the first element of gFontList,
  7682. #                the first element of gFontSizeList and the first two elements of 
  7683. #                gFontStyleList.
  7684. # Parameters:    none
  7685. # Returns:        theFontRecord - the font record that is generated
  7686. # Example:        myfontRecord := GenerateStandardFontRecord();
  7687. #                    
  7688. #========================================================================
  7689. Calls:    
  7690. Is called by:    
  7691.  
  7692.  
  7693. Task:    HandleDoubleByteStrings()
  7694. Library:    WorldReady.lib
  7695. Header:
  7696. #########################################################################
  7697. #                    HandleDoubleByteStrings()    
  7698. #========================================================================
  7699. # Author:        KTA
  7700. # Description:    Defines an override task for typeStr if the current script system
  7701. #                uses double byte characters.  The side effect of this task is
  7702. #                that the global gTypeStrOverRide will be defined and all calls to TypeStr()
  7703. #                will be redirected to call the task that has been defined for a specific 
  7704. #                script system. To remove the effects of this call it is possible to '
  7705. #                redefine gTypeStrOverRide as follows:
  7706. #                    global gTypeStrOverRide := 0;
  7707. # Parameters:    none
  7708. # Returns:        currScript - language identifier of the currently selected script
  7709. # Example:        HandleDoubleByteStrings();
  7710. #========================================================================
  7711. Calls:    CurrentlySelectedScript(), PrimaryScript(), SwitchScript(), TypeJapaneseString, 
  7712.         TypeSimplifiedChineseString, TypeTradChineseString
  7713. Is called by:    
  7714.  
  7715.  
  7716. Task:    TypeJapaneseString(pdumpedStr := '', 
  7717.         pJapaneseString := 'jikangaarebategamiwokudasarebaiitoomoimasu. ')
  7718. Library:    WorldReady.lib
  7719. Header:
  7720. #########################################################################
  7721. #                    TypeJapaneseString()    
  7722. #========================================================================
  7723. # Author:        KTA
  7724. # Description:    Types a predefined string that will generate a Japanese string when
  7725. #                typed into the bottom line input window. 
  7726. # Parameters:    pdumpedStr - When overriding TypeStr() the string that was
  7727. #                            to be typed is passed to the Overriding task.  It 
  7728. #                            is ignored in this task.
  7729. #                pJapaneseString - a string of characters that will produce a japanese 
  7730. #                             string when typed into the bottom line input window.
  7731. # Returns:        nothing
  7732. # Example:        TypeJapaneseString();
  7733. #========================================================================
  7734. Calls:    _type(), LogStr()
  7735. Is called by:    
  7736.  
  7737.  
  7738. Task:    TypeSimplifiedChineseString(pdumpedStr := '', 
  7739.         pSChineseString := {'wo1','men1','dou2','sh1','ping4','guo3',
  7740.             'dian1','nao2','gong2','si8','de1','hao1','peng1','you6'})
  7741. Library:    WorldReady.lib
  7742. Header:
  7743. #########################################################################
  7744. #                    TypeSimplifiedChineseString()    
  7745. #========================================================================
  7746. # Author:        KTA
  7747. # Description:    First option-shift-'c' will be typed to set the input method to Pinyin
  7748. #                Then, types a predefined string that will generate a SChinese string when
  7749. #                typed into the bottom line input window.
  7750. # Parameters:    pdumpedStr - When overriding TypeStr() the string that was
  7751. #                            to be typed is passed to the Overriding task.  It 
  7752. #                            is ignored in this task.
  7753. #                pSChineseString - a string of characters that will produce a SChinese 
  7754. #                             string when typed into the bottom line input window.
  7755. # Returns:        nothing
  7756. # Example:        TypeSimplifiedChineseString();
  7757. #========================================================================
  7758. Calls:    _presskey(), _type(), _releaseKey(), LogStr()
  7759. Is called by:    
  7760.  
  7761.  
  7762. Task:    TypeTradChineseString(pdumpedStr := '', 
  7763.         pTradChineseSting := {'wo 1','men 1','shi 1','zhong 1','guo 1',
  7764.             'ren 1','ta 1','men 1','shi 1','ben 1','di 1','ren 1'})
  7765. Library:    WorldReady.lib
  7766. Header:
  7767. #########################################################################
  7768. #                    TypeTradChineseString()    
  7769. #========================================================================
  7770. # Author:        KTA
  7771. # Description:    First the menuitem for Traditional Chises will be selected.
  7772. #                Then, option-shift-'c' will be typed to set the input method to Pinyin
  7773. #                Finally, Types a predefined string that will generate a TChinese string when
  7774. #                typed into the bottom line input window.
  7775. # Parameters:    pdumpedStr - When overriding TypeStr() the string that was
  7776. #                            to be typed is passed to the Overriding task.  It 
  7777. #                            is ignored in this task.
  7778. #                pTradChineseSting - a string of characters that will produce a TChinese 
  7779. #                             string when typed into the bottom line input window.
  7780. # Returns:        nothing
  7781. # Example:        TypeTradChineseString();
  7782. #========================================================================
  7783. Calls:    SelectMenuItem(), _presskey(), _type(), _releaseKey(), LogStr()
  7784. Is called by:    
  7785.  
  7786.  
  7787. Task:    RemoveTypeStrOverRide()
  7788. Library:    WorldReady.lib
  7789. Header:
  7790. #########################################################################
  7791. #                    RemoveTypeStrOverRide()    
  7792. #========================================================================
  7793. # Author:        KTA
  7794. # Description:    Removes whatever task reference that has been defined for gTypeStrOverRide
  7795. # Parameters:    none
  7796. # Returns:        nothing
  7797. # Example:        RemoveTypeStrOverRide();
  7798. #========================================================================
  7799. Calls:
  7800. Is called by:    
  7801.  
  7802.  
  7803. Task:    BuildListFromResource(idNum, pFileName := "")
  7804. Library:    WorldReady.lib
  7805. Header:
  7806. #########################################################################
  7807. #                BuildListFromResource(idNum, pFileName := "")
  7808. #========================================================================
  7809. # Author:        KTA 
  7810. # Description:    Returns a list generated from all of the strings in a specified
  7811. #                string list resource specified by <idNum> from the file specified
  7812. #                by pFileName.
  7813. # Parameters:    idNum := resource id number for the string list resource.
  7814. #                pFileName - full path name of file where string resource is located.
  7815. # Returns:        list - all strings in specified string list resource.
  7816. # Examples:        BuildListFromResource( 1000, FileOfTask() ); 
  7817. # Note:            If string resource is located in script which you're calling
  7818. #                this task from, use FileOfTask() to pass in full path
  7819. #                filename as per the above example.
  7820. #========================================================================
  7821. Calls:    GetIndString(), 
  7822. Is called by:    
  7823.  
  7824.  
  7825.  
  7826.  
  7827.  
  7828.  
  7829.  
  7830.  
  7831.  
  7832. ##############################################################
  7833. ##############################################################
  7834. SPEC Libraries Cross Reference.
  7835. End...
  7836. ##############################################################
  7837. ##############################################################
  7838.  
  7839.  
  7840.  
  7841.  
  7842.  
  7843.  
  7844.  
  7845. Task:
  7846. Library:    
  7847. Header:
  7848. ##############################################################
  7849. ##############################################################
  7850. Calls:
  7851. Is called by:    
  7852.  
  7853.  
  7854. Task:
  7855. Library:    
  7856. Header:
  7857. ##############################################################
  7858. ##############################################################
  7859. Calls:
  7860. Is called by:    
  7861.  
  7862.  
  7863. Task:
  7864. Library:    
  7865. Header:
  7866. ##############################################################
  7867. ##############################################################
  7868. Calls:
  7869. Is called by:    
  7870.  
  7871.  
  7872. Task:
  7873. Library:    
  7874. Header:
  7875. ##############################################################
  7876. ##############################################################
  7877. Calls:
  7878. Is called by:    
  7879.  
  7880.  
  7881. Task:
  7882. Library:
  7883. Header:
  7884. ##############################################################
  7885. ##############################################################
  7886. Calls:
  7887. Is called by:    
  7888.  
  7889.  
  7890. Task:
  7891. Library:
  7892. Header:
  7893. ##############################################################
  7894. ##############################################################
  7895. Calls:
  7896. Is called by:    
  7897.  
  7898.  
  7899.